Can't upgrade Scipy

五迷三道 提交于 2020-01-27 17:30:30

问题


I'm trying to upgrade Scipy from 0.9.0 to 0.12.0. I use the command:

sudo pip install --upgrade scipy

and I get all sorts of errors which can be seen in the pip.log file here and I'm unfortunately not python-savvy enough to understand what's wrong. Any help will be appreciated.


回答1:


The error messages all state the same: You lack BLAS (Basic Linear Algebra Subroutines) on your system, or scipy cannot find it. When installing packages from source in ubuntu, as you are effectively trying to do with pip, one of the easiest ways to make sure dependencies are in place is by the command

$ sudo apt-get build-dep python-scipy

which will install all packages needed to build the package python-scipy. You may in some cases run into the problem that the version of the source package you are trying to install have different dependencies than the version included with ubuntu, but in your case, I think chances are good that the above command will be sufficient to fetch BLAS for you, headers included.




回答2:


I had the same problem upgrading from scipy 0.9 to 0.13.3, and I solved it using the following answer and installing:

sudo apt-get install libblas-dev

sudo apt-get install liblapack-dev

sudo apt-get install gfortran




回答3:


Make sure libatlas-base-dev and libatlas-sse2-dev are installed, it seems like it can't find your atlas library. Also, see this question:

Does Python SciPy need BLAS?




回答4:


I found Adam Klein's instructions for setting up scipy (and friends) in a virtual environment very useful.

One problem I ran into (which was probably my own fault): After all was said and done, I found importing scipy still loaded version 0.9.0, not 0.12.0. The problem was that my sys.path was finding the old system version before the new version. The fix was to make

/path/to/.virtualenvs/arthur/local/lib/python2.7/site-packages

appear before

/usr/lib/python2.7/dist-packages

in sys.path. If you have virtualenvwrapper installed, then you can add the path using

add2virtualenv /path/to/.virtualenvs/arthur/lib/python2.7/site-packages


来源:https://stackoverflow.com/questions/17925381/cant-upgrade-scipy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!