由于导入错误,无法在使用虚拟环境的Windows上从命令行运行jupyter

时间:2019-03-14 14:49:29

标签: python-3.x jupyter-notebook virtualenv jupyter

您好,程序员们,我只是尝试结帐Jupyter Notebook。为此,我使用Python 3.5.1创建了一个全新的虚拟环境,并使用pip3 install jupyter命令安装了jupyter。但是,当我尝试运行jupyter notebook时,出现以下错误

(venv) C:\Users\srahman\Desktop\seaborn_test>jupyter notebook
Traceback (most recent call last):
  File "c:\users\srahman\appdata\local\programs\python\python35\Lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\srahman\appdata\local\programs\python\python35\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\srahman\Desktop\seaborn_test\venv\Scripts\jupyter-notebook.EXE\__main__.py", line 5, in <module>
  File "c:\users\srahman\desktop\seaborn_test\venv\lib\site-packages\notebook\__init__.py", line 25, in <module>
    from .nbextensions import install_nbextension
  File "c:\users\srahman\desktop\seaborn_test\venv\lib\site-packages\notebook\nbextensions.py", line 610, in <module>
    from .extensions import (
  File "c:\users\srahman\desktop\seaborn_test\venv\lib\site-packages\notebook\extensions.py", line 8, in <module>
    from tornado.log import LogFormatter
  File "c:\users\srahman\desktop\seaborn_test\venv\lib\site-packages\tornado\log.py", line 34, in <module>
    from tornado.escape import _unicode
  File "c:\users\srahman\desktop\seaborn_test\venv\lib\site-packages\tornado\escape.py", line 27, in <module>
    from tornado.util import unicode_type
  File "c:\users\srahman\desktop\seaborn_test\venv\lib\site-packages\tornado\util.py", line 21, in <module>
    from typing import (
ImportError: cannot import name 'Type'

这是我的虚拟环境中已安装软件包的列表(来自pip list

Package             Version
------------------- -------
attrs               19.1.0
backcall            0.1.0
bleach              3.1.0
colorama            0.4.1
decorator           4.3.2
defusedxml          0.5.0
entrypoints         0.3
ipykernel           5.1.0
ipython             7.3.0
ipython-genutils    0.2.0
ipywidgets          7.4.2
jedi                0.13.3
Jinja2              2.10
jsonschema          3.0.1
jupyter             1.0.0
jupyter-client      5.2.4
jupyter-console     6.0.0
jupyter-core        4.4.0
MarkupSafe          1.1.1
mistune             0.8.4
nbconvert           5.4.1
nbformat            4.4.0
notebook            5.7.6
pandocfilters       1.4.2
parso               0.3.4
pickleshare         0.7.5
pip                 19.0.3
prometheus-client   0.6.0
prompt-toolkit      2.0.9
Pygments            2.3.1
pyrsistent          0.14.11
python-dateutil     2.8.0
pywinpty            0.5.5
pyzmq               18.0.1
qtconsole           4.4.3
Send2Trash          1.5.0
setuptools          40.8.0
six                 1.12.0
terminado           0.8.1
testpath            0.4.2
tornado             6.0.1
traitlets           4.3.2
wcwidth             0.1.7
webencodings        0.5.1
wheel               0.33.1
widgetsnbextension  3.4.2
win-unicode-console 0.5

我尝试删除虚拟环境,重新创建一个,卸载并重新安装几次。我仍然遇到相同的错误。你能帮我吗?预先感谢。

0 个答案:

没有答案
相关问题