gpt4 book ai didi

python - 无法启动 Jupyter Notebook ModuleNotFoundError : No module named 'resource'

转载 作者:行者123 更新时间:2023-12-04 11:45:11 24 4
gpt4 key购买 nike

我已经从命令行使用 Jupyter Notebook 一个月了,今天我没有关闭正在运行的笔记本,而是让我的笔记本进入休眠状态 4 个小时。重新打开笔记本电脑后,我尝试再次运行笔记本电脑,从那以后我遇到了同样的错误。请帮帮我。

Traceback (most recent call last):
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\IPython\utils\timing.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:\users\chinmay\appdata\local\programs\python\python38-32\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\Chinmay\AppData\Local\Programs\Python\Python38-32\Scripts\jupyter-notebook.EXE\__main__.py", line 9, in <module>
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\jupyter_core\application.py", line 270, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\traitlets\config\application.py", line 663, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\notebook\notebookapp.py", line 1769, in initialize
self.init_webapp()
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\notebook\notebookapp.py", line 1451, in init_webapp
self.web_app = NotebookWebApplication(
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\notebook\notebookapp.py", line 153, in __init__
settings = self.init_settings(
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\notebook\notebookapp.py", line 269, in init_settings
nbextensions_path=jupyter_app.nbextensions_path,
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\notebook\notebookapp.py", line 1120, in nbextensions_path
from IPython.paths import get_ipython_dir
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\IPython\__init__.py", line 49, in <module>
from .terminal.embed import embed
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\IPython\terminal\embed.py", line 19, in <module>
from IPython.terminal.ipapp import load_default_config
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\IPython\terminal\ipapp.py", line 30, in <module>
from IPython.core.magics import ScriptMagics
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\IPython\core\magics\__init__.py", line 21, in <module>
from .execution import ExecutionMagics
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\IPython\core\magics\execution.py", line 46, in <module>
from IPython.utils.timing import clock, clock2
File "c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\IPython\utils\timing.py", line 64, in <module>
clocku = clocks = clock = time.clock
AttributeError: module 'time' has no attribute 'clock'```

最佳答案

打开此文件:c:\users\chinmay\appdata\local\programs\python\python38-32\lib\site-packages\IPython\utils\timing.py

  • import timeimport timeit
  • time.clocktimeit.default_timer

  • 这对我有用,应该对你有用。

    关于python - 无法启动 Jupyter Notebook ModuleNotFoundError : No module named 'resource' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60966135/

    24 4 0