Python下载numpy和pandas踩过的大坑
Posted wanglle
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python下载numpy和pandas踩过的大坑相关的知识,希望对你有一定的参考价值。
Python下载numpy和pandas踩过的大坑
最直接的安装方法是在python的scripts中执行 pip install pandas后,能出现Successfull是最好的,这也代表你已完成pandas的安装。下面的内容对你也没有用了。但是一般执行完后,dos窗口会出现各种报错。(Ps:我也是在网上找了各种各样的解决办法,看的人头大。下面是我的解决方法)
出现报错:
E:Python34Scripts>pip install pandas
Collecting pandas
Using cached https://files.pythonhosted.org/packages/08/01/803834bc8a4e708aede
bb133095a88a4dad9f45bbaf5ad777d2bea543c7e/pandas-0.22.0.tar.gz
Installing build dependencies ... done
Complete output from command python setup.py egg_info:
Could not locate executable g77
Could not locate executable f77
Could not locate executable ifort
Could not locate executable ifl
Could not locate executable f90
Could not locate executable DF
Could not locate executable efl
Could not locate executable gfortran
Could not locate executable f95
Could not locate executable g95
Could not locate executable efort
Could not locate executable efc
don‘t know how to compile Fortran code on platform ‘nt‘
non-existing path in ‘numpy\distutils‘: ‘site.cfg‘
Running from numpy source directory.
C:UsersadminAppDataLocalTempeasy_install-twd4zdzi
umpy-1.16.0setup.p
y:390: UserWarning: Unrecognized setuptools command, proceeding with generating
Cython sources and expanding templates
run_build = parse_setuppy_commands()
...............(报错信息太多,这边就不详细写了)
File "C:UsersadminAppDataLocalTemppip-build-env-2jkgt6h0Libsite-pa
ckagessetuptoolscommandeasy_install.py", line 1146, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: Microsoft V
isual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microso
ft.com/download/details.aspx?id=8279
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:UsersadminAp
pDataLocalTemppip-install-xuq5rc1upandas
我的解决方法:
1、https://www.lfd.uci.edu/~gohlke/pythonlibs/ 在该网址查找你自己对应的版本的numpy和pandas模块下载,需要下载在python的安装路径下的Scripts中。
2、在E:Python34Scripts路径上直接输入cmd命令,系统弹出dos窗口,然后执行pip install numpy-1.15.4+mkl-cp34-cp34m-win_amd64.whl(numpy-1.15.4+mkl-cp34-cp34m-win_amd64.whl代表的是你本地下载的numpy版本),执行结果出现Successfully installed numpy-1.15.4+mkl 代表numpy已安装成功。
E:Python34Scripts>pip install numpy-1.15.4+mkl-cp34-cp34m-win_amd64.whl
Processing e:python34scripts umpy-1.15.4+mkl-cp34-cp34m-win_amd64.whl
Installing collected packages: numpy
Successfully installed numpy-1.15.4+mkl
3、在E:Python34Scripts路径上直接输入cmd命令,系统弹出dos窗口,然后执行pip install pandas-0.20.3-cp34-cp34m-win_amd64.whl(pandas-0.20.3-cp34-cp34m-win_amd64.whl代表的是你本地下载的pandas版本),执行结果出现Successfully installed installed pandas-0.20.3 python-dateutil-2.7.5 pytz-2018.9 six-1.12.0 代表pandas已安装成功。
E:Python34Scripts>pip install pandas-0.20.3-cp34-cp34m-win_amd64.whl
Processing e:python34scripts umpy-1.15.4+mkl-cp34-cp34m-win_amd64.whl
Installing collected packages: numpy
Successfully installed numpy-1.15.4+mkl
..............
..............
Collecting six>=1.5 (from python-dateutil>=2->pandas==0.20.3)
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe8
98238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, pytz, pandas
Successfully installed pandas-0.20.3 python-dateutil-2.7.5 pytz-2018.9 six-1.12.0
以上是关于Python下载numpy和pandas踩过的大坑的主要内容,如果未能解决你的问题,请参考以下文章