Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 ImportError:…/lib64/python2.7/site-packages/scipy/special//u ufuncs.so:undefined symbol:npy\u exp_Python 2.7_Numpy_Scipy_Undefined Symbol - Fatal编程技术网

Python 2.7 ImportError:…/lib64/python2.7/site-packages/scipy/special//u ufuncs.so:undefined symbol:npy\u exp

Python 2.7 ImportError:…/lib64/python2.7/site-packages/scipy/special//u ufuncs.so:undefined symbol:npy\u exp,python-2.7,numpy,scipy,undefined-symbol,Python 2.7,Numpy,Scipy,Undefined Symbol,我在CentOS 6.5上工作,默认情况下它有python 2.6。因此,我手动安装了Python2.7,并在“/home/thomas/Programs/python-2.7_项目”中使用virtualenv设置了一个沙箱 然后我编译了numpy和scipy,如下所示: chmod -R 777 /home/thomas/Programs/python-2.7_project source /home/thomas/Programs/python-2.7_project/bin/activat

我在CentOS 6.5上工作,默认情况下它有python 2.6。因此,我手动安装了Python2.7,并在“/home/thomas/Programs/python-2.7_项目”中使用virtualenv设置了一个沙箱

然后我编译了numpy和scipy,如下所示:

chmod -R 777 /home/thomas/Programs/python-2.7_project
source /home/thomas/Programs/python-2.7_project/bin/activate
export PYTHONPATH=/home/thomas/Programs/python-2.7_project/lib64/python2.7/site-packages:$PYTHONPATH
sudo yum remove numpy scipy
sudo yum -y install blas lapack atlas atlas-devel mercurial
sudo ln -s /usr/lib64/libblas.so.3 /usr/lib64/libblas.so
sudo ln -s /usr/lib64/liblapack.so.3 /usr/lib64/liblapack.so
sudo ln -s /usr/lib64/atlas/libatlas.so.3 /usr/lib64/atlas/libatlas.so
export BLAS=/usr/lib64/libblas.so
export LAPACK=/usr/lib64/liblapack.so
export ATLAS=/usr/lib64/atlas/libatlas.so

git clone git://github.com/numpy/numpy.git numpy
cd numpy
python setup.py build
python setup.py install --prefix=/home/thomas/Programs/python-2.7_project

# for scipy
pip install cython # necessary for scipy
git clone git://github.com/scipy/scipy.git scipy
cd scipy
python setup.py build
python setup.py install --prefix=/home/thomas/Programs/python-2.7_project
但是,当我从scipy.stats导入一些函数时,会出现以下错误:

Traceback (most recent call last):
  File "/usr/local/bin/RescoringTK.py", line 66, in <module>
    from scipy.stats import pearsonr, linregress, zscore
  File "/home/thomas/Programs/python-2.7_project/lib64/python2.7/site-packages/scipy/stats/__init__.py", line 334, in <module>
    from .stats import *
  File "/home/thomas/Programs/python-2.7_project/lib64/python2.7/site-packages/scipy/stats/stats.py", line 181, in <module>
    import scipy.special as special
  File "/home/thomas/Programs/python-2.7_project/lib64/python2.7/site-packages/scipy/special/__init__.py", line 546, in <module>
    from ._ufuncs import *
ImportError: /home/thomas/Programs/python-2.7_project/lib64/python2.7/site-packages/scipy/special/_ufuncs.so: undefined symbol: npy_exp
回溯(最近一次呼叫最后一次):
文件“/usr/local/bin/RescoringTK.py”,第66行,在
从scipy.stats导入pearsonr、linregress、zscore
文件“/home/thomas/Programs/python-2.7_project/lib64/python2.7/site packages/scipy/stats/_init__.py”,第334行,在
从.stats导入*
文件“/home/thomas/Programs/python-2.7_project/lib64/python2.7/site packages/scipy/stats/stats.py”,第181行,在
将scipy.special作为特殊导入
文件“/home/thomas/Programs/python-2.7_project/lib64/python2.7/site packages/scipy/special/_init__.py”,第546行,在
从.\u ufuncs导入*
ImportError:/home/thomas/Programs/python-2.7_project/lib64/python2.7/site-packages/scipy/special//u ufuncs.so:未定义符号:npy\u exp

有人知道错误的原因吗?

像Anaconda或CanopyIt这样的发行版更容易使用。它不提供python 2.7。Anaconda提供。我正在使用默认安装的Anaconda,Python2.7.6Wow!我要是早点发现就好了!非常感谢。
Traceback (most recent call last):
  File "/usr/local/bin/RescoringTK.py", line 66, in <module>
    from scipy.stats import pearsonr, linregress, zscore
  File "/home/thomas/Programs/python-2.7_project/lib64/python2.7/site-packages/scipy/stats/__init__.py", line 334, in <module>
    from .stats import *
  File "/home/thomas/Programs/python-2.7_project/lib64/python2.7/site-packages/scipy/stats/stats.py", line 181, in <module>
    import scipy.special as special
  File "/home/thomas/Programs/python-2.7_project/lib64/python2.7/site-packages/scipy/special/__init__.py", line 546, in <module>
    from ._ufuncs import *
ImportError: /home/thomas/Programs/python-2.7_project/lib64/python2.7/site-packages/scipy/special/_ufuncs.so: undefined symbol: npy_exp