ModuleNotFoundError:没有名为“ jupyter_tabnine”的模块

时间:2020-02-07 14:04:45

标签: jupyter-notebook

我试图这样安装jupyter tabnine扩展程序:

pip3 install jupyter-tabnine
jupyter nbextension install

使用第二个命令,我遇到此错误:

Installing /home/rouizi/.local/lib/python3.6/site-packages/jupyter_tabnine/static -> jupyter_tabnine
Traceback (most recent call last):
  File "/home/rouizi/.local/bin/jupyter-nbextension", line 11, in <module>
    sys.exit(main())
  File "/home/rouizi/.local/lib/python3.6/site-packages/jupyter_core/application.py", line 268, in 
launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/rouizi/.local/lib/python3.6/site-packages/traitlets/config/application.py", line 664, in 
launch_instance
    app.start()
  File "/home/rouizi/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 983, in start
    super(NBExtensionApp, self).start()
  File "/home/rouizi/.local/lib/python3.6/site-packages/jupyter_core/application.py", line 257, in start
    self.subapp.start()
  File "/home/rouizi/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 711, in start
    self.install_extensions()
  File "/home/rouizi/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 690, in 
install_extensions
    **kwargs
  File "/home/rouizi/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 220, in 
install_nbextension_python
    destination=dest, logger=logger
  File "/home/rouizi/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 121, in 
install_nbextension
    ensure_dir_exists(nbext)
  File "/home/rouizi/.local/lib/python3.6/site-packages/jupyter_core/utils/__init__.py", line 13, in 
ensure_dir_exists
    os.makedirs(path, mode=mode)
  File "/usr/lib/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/usr/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/share/jupyter'

所以我尝试了sudo

sudo jupyter nbextension install --py jupyter_tabnine

Traceback (most recent call last):
  File "/snap/jupyter/6/bin/jupyter-nbextension", line 11, in <module>
    sys.exit(main())
  File "/snap/jupyter/6/lib/python3.7/site-packages/jupyter_core/application.py", line 266, in 
launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/snap/jupyter/6/lib/python3.7/site-packages/traitlets/config/application.py", line 658, in 
launch_instance
    app.start()
  File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/nbextensions.py", line 988, in start
    super(NBExtensionApp, self).start()
  File "/snap/jupyter/6/lib/python3.7/site-packages/jupyter_core/application.py", line 255, in start
    self.subapp.start()
  File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/nbextensions.py", line 716, in start
    self.install_extensions()
  File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/nbextensions.py", line 695, in 
install_extensions
    **kwargs
  File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/nbextensions.py", line 211, in 
install_nbextension_python
    m, nbexts = _get_nbextension_metadata(module)
  File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/nbextensions.py", line 1122, in 
_get_nbextension_metadata
    m = import_item(module)
  File "/snap/jupyter/6/lib/python3.7/site-packages/traitlets/utils/importstring.py", line 42, in 
import_item
    return __import__(parts[0])
ModuleNotFoundError: No module named 'jupyter_tabnine'

似乎找不到模块jupyter_tabnine,我该如何解决?

2 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,但是似乎可以通过以下升级解决:

pip3 install jupyter-tabnine --upgrade

如果不适合您,请尝试sudo:

 sudo pip3 install jupyter-tabnine --upgrade

升级后,我尝试解决问题:

sudo jupyter nbextension install --py jupyter_tabnine

希望您的工作顺利完成。

答案 1 :(得分:0)

亲爱的 我建议您遵循以下方法,并且喜欢使用

  1. pip install jupyter_contrib_nbextensions
  2. jupyter contrib nbextension install --user
  3. 启动jupyter笔记本
  4. 其中一个标签现在应显示“ Nbextensions”
  5. 在那里,您会找到“腹地”。选中复选框以启用。

必须尝试