python 尽管安装了模块6,但未找到模块6

j1dl9f46  于 2023-02-02  发布在  Python
关注(0)|答案(3)|浏览(163)

我无法运行jupyter实验室,因为它抱怨模块6。模块6已经安装在conda上了。我甚至试着用pip安装,但是它说它已经安装了,什么也没做。那么,这里该怎么办呢?

jupyter lab
Traceback (most recent call last):
  File "c:\users\ilyas\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\ilyas\anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\ilyas\Anaconda3\Scripts\jupyter-lab.EXE\__main__.py", line 5, in <module>
  File "c:\users\ilyas\anaconda3\lib\site-packages\jupyterlab\labapp.py", line 11, in <module>
    from jupyter_core.application import JupyterApp, base_aliases
  File "c:\users\ilyas\anaconda3\lib\site-packages\jupyter_core\application.py", line 30, in <module>
    from traitlets.config.application import Application, catch_config_error
  File "c:\users\ilyas\anaconda3\lib\site-packages\traitlets\__init__.py", line 1, in <module>
    from .traitlets import *
  File "c:\users\ilyas\anaconda3\lib\site-packages\traitlets\traitlets.py", line 57, in <module>
    import six
ModuleNotFoundError: No module named 'six'

我试图删除与康达,然后重新安装,但也没有工作:

conda remove six
RemoveError: This operation will remove conda without replacing it with
another version of conda.

用管道安装:

pip install six
Requirement already satisfied: six in c:\users\ilyas\anaconda3\lib\site-packages (1.12.0)

python -m pip install six
Requirement already satisfied: six in c:\users\ilyas\anaconda3\lib\site-packages (1.12.0)

环境:

  • windows 10
  • Python 3.7
  • 木星实验室1.0.0a3
  • 六个1.12.0版本
pdtvr36n

pdtvr36n1#

您正在为Python 2安装six,但试图从Python 3使用它。
使用以下命令安装Python 3:
python3 -m pip install six

flvlnr44

flvlnr442#

已尝试以下问题,但仍无法解决:
我不得不在以下错误中这样做:

pip uninstall six

pip install six

然后我得到了ModuleNotFoundError: No module named 'jupyter_server'错误。
所以我用conda安装了jupyter_server,现在jupyter实验室可以工作了。

conda install -c conda-forge jupyter_server

即使笔记本打开了,我也不能导入包。检查命令提示符显示jupyterlab-manager已经过时了。所以,做了以下操作:

jupyter labextension install @jupyter-widgets/jupyterlab-manager

笔记本仍然打开,但无法对其执行任何操作。

5m1hhzi4

5m1hhzi43#

晚了几年,但我也遇到了同样的问题。为了补充科里所说的一点。我认为你需要通过康达安装它才能在康达(因此Jupyter)中使用它,IoidoEe。
康达安装六

相关问题