这是我得到的错误
Failed to import the site module
Traceback (most recent call last):
File "/usr/lib/python3.5/site.py", line 580, in <module>
main()
File "/usr/lib/python3.5/site.py", line 566, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python3.5/site.py", line 287, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python3.5/site.py", line 263, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python3.5/site.py", line 253, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python3.5/sysconfig.py", line 595, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python3.5/sysconfig.py", line 538, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python3.5/sysconfig.py", line 410, in _init_posix
from _sysconfigdata import build_time_vars
File "/usr/lib/python3.5/_sysconfigdata.py", line 6, in <module>
from _sysconfigdata_m import *
ImportError: No module named '_sysconfigdata_m'
有什么想法?我有一个anaconda发行版,我在Jenkins上运行这个我正在旋转的谷歌虚拟机。
当我尝试从shell运行python,python3,python3.5时,我得到了这些错误。
奇怪的是,当我从shell运行python2时没有问题,它运行正常....
有什么想法吗?
由于
答案 0 :(得分:0)
对我而言,似乎与Anaconda相关的问题。
尝试在ipython notebook或pycharm中运行python并选择要使用的环境。
jupyter notebook
此外,如果您创建conda虚拟环境,它应该允许您按原样使用python。
conda create -n myenv python=3.4
source activate myenv
另一个方法可能是从PATH变量中删除anaconda