简体   繁体   English

尝试启动 Jupyter Notebook (Python) 时出现运行时错误

[英]Runtime Error when trying to launch Jupyter Notebook (Python)

I usually work with the Jupyter Notebook Interface when programming Python but recently I installed bioservices through pip (Bioservices) and when I tried to open the Jupyter Notebook I get the following RunTime error:在编程 Python 时,我通常使用 Jupyter Notebook 接口,但最近我通过 pip (Bioservices)安装了 bioservices,当我尝试打开 Jupyter Notebook 时,出现以下运行时错误:

~$ jupyter notebook ~$ jupyter 笔记本

Traceback (most recent call last):回溯(最近一次调用最后一次):

File "/usr/local/bin/jupyter-notebook", line 7, in <module>
from notebook.notebookapp import main

File "/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py", line 60, in <module>
from .services.contents.manager import ContentsManager

File "/usr/local/lib/python2.7/dist-packages/notebook/services/contents/manager.py", line 16, in <module>
from nbformat import sign, validate, ValidationError

File "/usr/local/lib/python2.7/dist-packages/nbformat/__init__.py", line 33, in <module>
from .validator import validate, ValidationError

File "/usr/local/lib/python2.7/dist-packages/nbformat/validator.py", line 12, in <module>
from jsonschema import ValidationError

File "/usr/local/lib/python2.7/dist-packages/jsonschema/__init__.py", line 18, in <module>
from jsonschema.validators import (

File "/usr/local/lib/python2.7/dist-packages/jsonschema/validators.py", line 8, in <module>
import requests

File "/home/bioinfo/.local/lib/python2.7/site-packages/requests/__init__.py", line 74, in <module>

raise RuntimeError('Requests dependency \'chardet\' must be version >= 3.0.2, < 3.1.0!')

RuntimeError: Requests dependency 'chardet' must be version >= 3.0.2, < 3.1.0!

PS: I uninstalled bioservices and it did not solve the error! PS:我卸载了bioservices并没有解决错误! Tried to reinstall chardet but it give the next output:试图重新安装 chardet 但它给出了下一个输出:

~$ pip install chardet==3.0.2 ~$ pip install chardet==3.0.2

Collecting chardet==3.0.2收集chardet==3.0.2

Using cached chardet-3.0.2-py2.py3-none-any.whl使用缓存的 chardet-3.0.2-py2.py3-none-any.whl

Installing collected packages: chardet安装收集的软件包:chardet

Successfully installed chardet-2.3.0成功安装chardet-2.3.0

This looks like a broken dependency.这看起来像是一个破碎的依赖。 Have you tried installing the correct version of the chardet package, eg您是否尝试安装正确版本的 chardet 包,例如

pip install chardet==3.0.2

Of course here I'm assuming you have pip installed.当然,这里我假设您已经安装了 pip。 Otherwise you're stuck with what your system ships.否则,您会被系统附带的内容所困扰。 In that case, I would advise installing pip or any alternative way to control you python installation on a finer level.在这种情况下,我建议安装 pip 或任何替代方法来在更精细的级别上控制您的 python 安装。

Apparently you have a package named chardet required somewhere, but the version of this module is deprecated.显然,您在某处需要一个名为 chardet 的包,但不推荐使用该模块的版本。 Try to update chardet with pip upgrade chardet or uninstall and reinstall it.尝试使用pip upgrade chardet更新 chardet 或卸载并重新安装它。

$ pip uninstall chardet
$ pip install chardet

I have also same error.我也有同样的错误。 after trying all it doesn't work for me.在尝试了所有之后,它对我不起作用。 so I simply uninstall it:所以我只是卸载它:

pip uninstall jupyter

Then again install jupyter notebook (it doesn't remove your installed library, simply uninstall jupyter) let's try然后再次安装 jupyter notebook(它不会删除您已安装的库,只需卸载 jupyter)让我们尝试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM