目标:设置python以使用Anaconda2环境运行
我在我的主文件夹中更新了.bash_profile并首先指向anaconda2。
export PATH =" / Users / myname / anaconda2 / bin:/ usr / bin:/ bin:/ usr / sbin:/ sbin:/ usr / local / bin:$ PATH"
但是当我在终端回应$ PATH时,我得到了回复:/Users/myname/anaconda2/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
所有额外的东西都来自哪里?它不在我的档案中。
这可以解释为什么我的.py文件说他们找不到我从脚本调用的任何已安装的anaconda2模块,比如numpy和numba吗?
当我运行" python /users/myname/desktop/stackoverflow.py"在命令行我收回这些错误:
Traceback (most recent call last): File "/users/myname/desktop/stackoverflow.py", line 1, in <module>
import numpy as np File "/Users/myname/anaconda2/lib/python2.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs File "/Users/myname/anaconda2/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc File "/Users/myname/anaconda2/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import * File "/Users/myname/anaconda2/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx File "/Users/myname/anaconda2/lib/python2.7/site-packages/numpy/core/__init__.py", line 34, in <module>
from . import umath ImportError: dlopen(/Users/myname/anaconda2/lib/python2.7/site-packages/numpy/core/umath.so, 2): Symbol not found: ___sincos_stret Referenced from: /Users/myname/anaconda2/lib/python2.7/site-packages/numpy/core/umath.so Expected in: /usr/lib/libSystem.B.dylib in /Users/myname/anaconda2/lib/python2.7/site-packages/numpy/core/umath.so