Python 安装 scipy 报错如何解决?
不知道为啥
Command ““c:\program files\python36\python.exe” -u -c “import setuptools, tokenize;file=‘C:\Users\yeyu1\AppData\Local\Temp\pip-build-x4ee7wgj\scipy\setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record C:\Users\yeyu1\AppData\Local\Temp\pip-45fmpc19-record\install-record.txt --single-version-externally-managed --compile” failed with error code 1 in C:\Users\yeyu1\AppData\Local\Temp\pip-build-x4ee7wgj\scipy<br>Python 安装 scipy 报错如何解决?
用 whl 文件升级一下 setuptools 试试?
装scipy报错多半是依赖问题。最稳的方法是先装numpy再装scipy,或者直接用conda管理环境。
如果pip安装失败,可以试试:
pip install numpy --upgrade
pip install scipy --upgrade
如果还不行,可能是缺少系统级依赖(比如BLAS/LAPACK)。在Ubuntu上可以:
sudo apt-get install gcc gfortran python3-dev libopenblas-dev
Windows用户建议直接下载预编译的whl文件安装,或者用Anaconda:
conda install scipy
总结:优先用conda,其次检查系统依赖。
经常出错,装个 anaconda 吧
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy 下载相应版本的 .whl 文件
pip install wheel
pip install scipy ‑ 0.19.1 ‑ cp27 ‑ cp27m ‑ win32.whl
别折腾,用 anaconda。
既然你用了 scipy 肯定还会用到其他的科学计算包,conda 解决无穷后患,你的时间很宝贵。
conda+1
miniconda
3l 的方法可行 试过
不过,最好的办法还是 anaconda
这种科学计算的 conda 一步到位
一直坚挺 anaconda
https://anaconda.org/ 你可能需要这个
Win 上用 anaconda,一个包装优化过的 Python 环境,可以很大程度上避免这种问题……
建议 anaconda
miniconda 都各种 报错 崩溃 不稳定,pip 甭想了
win 上如果没有搜到 binary 包理论上是装不上 scipy 的,放弃吧
参照 https://stackoverflow.com/questions/2213551/installing-scipy-with-pip<br>To install scipy on windows follow these instructions:-<br><br>Step-1 : Press this link <a target="_blank" href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy" rel="nofollow noopener">http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy</a> to download a scipy .whl file (e.g. scipy-0.17.0-cp34-none-win_amd64.whl).<br><br>Step-2: Go to the directory where that download file is there from the command prompt (cd folder-name ).<br><br>Step-3: Run this command:<br><br>pip install scipy-0.19.1-cp36-cp36m-win_amd64.whl<br>


