问题描述
我是python和虚拟环境新手.更新conda后,我无法打开jupyter笔记本电脑和Spyder.
I'm new to python and the virtual environment stuff. I'm facing issues opening jupyter notebook and Spyder after updating conda.
以下是有关我拥有的版本的一些信息:
Here are some info about the versions I have:
$ conda info
active environment : None '''is it caused by this ? '''
user config file : /Users/-/.condarc
populated config files : /Users/-/.condarc
conda version : 4.5.4
conda-build version : 3.0.27
python version : 2.7.14.final.0
base environment : /Users/-/anaconda2 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/osx-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/osx-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/pro/osx-64
https://repo.anaconda.com/pkgs/pro/noarch
package cache : /Users/-/anaconda2/pkgs
/Users/-/.conda/pkgs
envs directories : /Users/-/anaconda2/envs
/Users/-/.conda/envs
platform : osx-64
user-agent : conda/4.5.4 requests/2.18.4 CPython/2.7.14 Darwin/15.5.0 OSX/10.11.5
UID:GID : 501:20
netrc file : None
offline mode : False
JupyerNotebook version : 5.5.0
Jupyter version : 4.4.0
Spyder version : 3.2.8
Spyder无法启动,并且尝试从anaconda导航器启动spyder时出现此错误:
Spyder fails to launch and when trying to launch spyder from anaconda navigator I get this error:
/anaconda2/lib/python2.7/site-packages/zmq/backend/cython/ init .py",第6行, 从 .导入(常量,错误,消息,上下文, ImportError:dlopen(/Users/-/anaconda2/lib/python2.7/site-packages/zmq/backend/cython/error.so,2):库未加载:@ rpath/libsodium.23.dylib 引用自:/Users/-/anaconda2/lib/libzmq.5.dylib 原因:找不到图片
/anaconda2/lib/python2.7/site-packages/zmq/backend/cython/init.py", line 6, in from . import (constants, error, message, context, ImportError: dlopen(/Users/-/anaconda2/lib/python2.7/site-packages/zmq/backend/cython/error.so, 2): Library not loaded: @rpath/libsodium.23.dylib Referenced from: /Users/-/anaconda2/lib/libzmq.5.dylib Reason: image not found
尝试从anaconda启动jupyter笔记本会引发相同的image not found
错误:
Trying to launch jupyter notebook from anaconda throws the same image not found
error:
/anaconda2/lib/python2.7/site-packages/zmq/backend/cython/ init .py",第6行, 从 .导入(常量,错误,消息,上下文, ImportError:dlopen(/Users/-/anaconda2/lib/python2.7/site-packages/zmq/backend/cython/error.so,2):库未加载:@ rpath/libsodium.23.dylib 引用自:/Users/-/anaconda2/lib/libzmq.5.dylib 原因:找不到图片
/anaconda2/lib/python2.7/site-packages/zmq/backend/cython/init.py", line 6, in from . import (constants, error, message, context, ImportError: dlopen(/Users/-/anaconda2/lib/python2.7/site-packages/zmq/backend/cython/error.so, 2): Library not loaded: @rpath/libsodium.23.dylib Referenced from: /Users/-/anaconda2/lib/libzmq.5.dylib Reason: image not found
我发现更新后,仅为zmq
文件/anaconda2/lib/python2.7/site-packages/zmq/backend/cffi/__pycache__
初始化了一个新的Anaconda2文件夹.
I found out that after updating, a new Anaconda2 folder was initialized for only the zmq
file /anaconda2/lib/python2.7/site-packages/zmq/backend/cffi/__pycache__
.
一切正常,但是按照anaconda的说明和建议进行更新后,我开始遇到这些错误.
Everything was working smoothly but after following anaconda instructions and recommendations to update I started getting those errors.
如何解决此问题?是因为active environment : None
吗?
How can I resolve this issue? Is it because the active environment : None
?
推荐答案
遇到同样的问题.在 https://github.com/jupyter/notebook/issues/1632 中,它解释说,更新conda时有些依赖性被弄乱了,所以请尝试:
Faced same issue. From https://github.com/jupyter/notebook/issues/1632 it explained that some dependencies when updating conda are messed up so try:
conda remove zeromq
conda install zeromq
然后尝试:
conda update conda-build
祝你好运
这篇关于未找到图像时,启动Spyder和JupyterNotebook会导致importError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!