无法启动 Jupyter Notebook ModuleNotFoundError:没有名为“资源"的模块 [英] Can't launch Jupyter Notebook ModuleNotFoundError: No module named 'resource'
本文介绍了无法启动 Jupyter Notebook ModuleNotFoundError:没有名为“资源"的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经从命令行使用 Jupyter Notebook 一个月了,今天我没有关闭正在运行的笔记本,而是让我的笔记本进入睡眠状态 4 个小时.重新打开笔记本电脑后,我尝试再次运行笔记本电脑,从那以后我遇到了同样的错误.请帮帮我.
I've been using Jupyter Notebook from the command line for a month now, today I didn't shut the running notebook and put my laptop to sleep for 4 hours. After turning my laptop back on I tried to run the notebook again and I'm getting the same error ever since. Please help me out.
Traceback (most recent call last):
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packagesIPythonutils iming.py", line 27, in <module>
import resource
ModuleNotFoundError: No module named 'resource'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:userschinmayappdatalocalprogramspythonpython38-32lib
unpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:userschinmayappdatalocalprogramspythonpython38-32lib
unpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:UsersChinmayAppDataLocalProgramsPythonPython38-32Scriptsjupyter-notebook.EXE\__main__.py", line 9, in <module>
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packagesjupyter_coreapplication.py", line 270, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packages raitletsconfigapplication.py", line 663, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packages raitletsconfigapplication.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packages
otebook
otebookapp.py", line 1769, in initialize
self.init_webapp()
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packages
otebook
otebookapp.py", line 1451, in init_webapp
self.web_app = NotebookWebApplication(
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packages
otebook
otebookapp.py", line 153, in __init__
settings = self.init_settings(
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packages
otebook
otebookapp.py", line 269, in init_settings
nbextensions_path=jupyter_app.nbextensions_path,
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packages
otebook
otebookapp.py", line 1120, in nbextensions_path
from IPython.paths import get_ipython_dir
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packagesIPython\__init__.py", line 49, in <module>
from .terminal.embed import embed
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packagesIPython erminalembed.py", line 19, in <module>
from IPython.terminal.ipapp import load_default_config
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packagesIPython erminalipapp.py", line 30, in <module>
from IPython.core.magics import ScriptMagics
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packagesIPythoncoremagics\__init__.py", line 21, in <module>
from .execution import ExecutionMagics
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packagesIPythoncoremagicsexecution.py", line 46, in <module>
from IPython.utils.timing import clock, clock2
File "c:userschinmayappdatalocalprogramspythonpython38-32libsite-packagesIPythonutils iming.py", line 64, in <module>
clocku = clocks = clock = time.clock
AttributeError: module 'time' has no attribute 'clock'```
推荐答案
打开这个文件:c:userschinmayappdatalocalprogramspythonpython38-32libsite-packagesIPythonutils iming.py
- 将
import time
改为import timeit
- 将
time.clock
改为timeit.default_timer
这对我有用,对你也有用.
This worked for me, should work for you.
这篇关于无法启动 Jupyter Notebook ModuleNotFoundError:没有名为“资源"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文