Skip to content

Keeping restarting kernel  #249

@eromoe

Description

@eromoe

I run jupyter in docker. It is fine ,but today I meet below error:

[I 01:07:02.193 NotebookApp] KernelRestarter: restarting kernel (4/5)
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.5/runpy.py", line 133, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/usr/local/lib/python3.5/dist-packages/ipykernel/__init__.py", line 2, in <module>
    from .connect import *
  File "/usr/local/lib/python3.5/dist-packages/ipykernel/connect.py", line 10, in <module>
    from subprocess import Popen, PIPE
  File "/usr/lib/python3.5/subprocess.py", line 441, in <module>
    import threading
  File "/usr/lib/python3.5/threading.py", line 7, in <module>
    from traceback import format_exc as _format_exc
  File "/usr/lib/python3.5/traceback.py", line 5, in <module>
    import linecache
  File "/usr/lib/python3.5/linecache.py", line 11, in <module>
    import tokenize
  File "/data/corpus/tokenize.py", line 12, in <module>
    import jieba
  File "/usr/local/lib/python3.5/dist-packages/jieba/__init__.py", line 9, in <module>
    import logging
  File "/usr/lib/python3.5/logging/__init__.py", line 206, in <module>
    _lock = threading.RLock()
AttributeError: module 'threading' has no attribute 'RLock'

Restart kernel not work, restart docker containner not work.

Then I build a fresh docker image, still error, something like:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.5/runpy.py", line 133, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/usr/local/lib/python3.5/dist-packages/ipykernel/__init__.py", line 2, in <module>
    from .connect import *
  File "/usr/local/lib/python3.5/dist-packages/ipykernel/connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
  File "/usr/local/lib/python3.5/dist-packages/IPython/__init__.py", line 48, in <module>
    from .core.application import Application
  File "/usr/local/lib/python3.5/dist-packages/IPython/core/application.py", line 25, in <module>
    from IPython.core import release, crashhandler
  File "/usr/local/lib/python3.5/dist-packages/IPython/core/crashhandler.py", line 28, in <module>
    from IPython.core import ultratb
  File "/usr/local/lib/python3.5/dist-packages/IPython/core/ultratb.py", line 111, in <module>
    generate_tokens = tokenize.tokenize
AttributeError: module 'tokenize' has no attribute 'tokenize'

Activity

eromoe

eromoe commented on Mar 24, 2017

@eromoe
Author

OK, I think I found the problem. There is a build-in lib named tokenize which , and I have a tokenize.py file under current folder.

binary10

binary10 commented on May 18, 2019

@binary10
Exception ignored in: <module 'threading' from '/Users/user1/Downloads/threading.py'>
AttributeError: module 'threading' has no attribute '_shutdown'

I installed Jupyter through pip and the kernel is not starting. Retries all end in failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @binary10@eromoe

        Issue actions

          Keeping restarting kernel · Issue #249 · jupyter/jupyter