运行CentOS并尝试在conda中安装python 2 env以与Jupyter一起使用,但遇到了一个问题,即它一直关注/ py36 env文件夹而不是py27
我尝试重新安装python,更新CentOS,但结果仍然相同。
(py27) [root@mam-s529 strong]# python -m ipykernel install --user --name py27 --display-name "py27"
Traceback (most recent call last):
File "/bin/anaconda3/envs/py27/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/bin/anaconda3/envs/py27/lib/python2.7/runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "/bin/anaconda3/envs/py36/lib/python3.6/site-packages/ipykernel/__init__.py", line 2, in <module>
from .connect import *
File "/bin/anaconda3/envs/py36/lib/python3.6/site-packages/ipykernel/connect.py", line 18, in <module>
import jupyter_client
File "/bin/anaconda3/envs/py36/lib/python3.6/site-packages/jupyter_client/__init__.py", line 4, in <module>
from .connect import *
File "/bin/anaconda3/envs/py36/lib/python3.6/site-packages/jupyter_client/connect.py", line 22, in <module>
import zmq
File "/bin/anaconda3/envs/py36/lib/python3.6/site-packages/zmq/__init__.py", line 34, in <module>
from zmq import backend
File "/bin/anaconda3/envs/py36/lib/python3.6/site-packages/zmq/backend/__init__.py", line 40, in <module>
reraise(*exc_info)
File "/bin/anaconda3/envs/py36/lib/python3.6/site-packages/zmq/backend/__init__.py", line 27, in <module>
_ns = select_backend(first)
File "/bin/anaconda3/envs/py36/lib/python3.6/site-packages/zmq/backend/select.py", line 26, in select_backend
mod = __import__(name, fromlist=public_api)
File "/bin/anaconda3/envs/py36/lib/python3.6/site-packages/zmq/backend/cython/__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: cannot import name constants
如何更改环境或修复在其中查找zmq和其他模块的位置?
任何帮助或指点表示赞赏!