在Windows系统中安装Numpy,Scipy,pandas,matplotlib

先从pip和Scripts文件夹说起
pip是python的包管理工具,Scripts是python根目录下的一个文件夹。我们家下载好的要安装的四个文件都放在Scripts文件夹中。
如果一切顺利,直接在windows命令行进入到Scripts文件夹下使用
pip install xxx.whl命令即可安装。
此处给出一个良心网站:https://www.lfd.uci.edu/~gohlke/pythonlibs/
它里面拥有大量的做python开发需要用到的包。
在官网下载Numpy安装是没有问题的,但是当我们再安装从官网下载的Scipy时会报错。
原因:看到有网友说Scipy依赖numpy-1.16.5+mkl-cp36-cp36m-win_amd64.whl(找到自己适合的版本);所以我们先安装这个包。
用pip -m pip install -U pip 将pip更新到最新版本(可以用pip show pip查看自己的pip版本,不更新可能在安装包时提示更新,但是给出的语句是:python -m pip install --upgrade pip ,但是我自己的不好使,也有人说如果是python3.X就用:python3 -m pip install --upgrade pip;我的python确实是python3.X但是也不好使,最后就选择了pip -m pip install -U pip,它可以卸载以前的旧版本并且更新到最新版本)
完事之后在用python命令进入到python环境中
import pip._internal
print(pip._internal.pep425tags.get_supported())
查看自己适合什么样类型的包,去上面给出的网站中下载。
下载完之后就可以安装了:

C:\Users\Administrator>cd Documents

C:\Users\Administrator\Documents>cd programFiles

C:\Users\Administrator\Documents\programFiles>cd PythonPython3.6.6

C:\Users\Administrator\Documents\programFiles\PythonPython3.6.6>cd Scripts

C:\Users\Administrator\Documents\programFiles\PythonPython3.6.6\Scripts>pip install "numpy-1.16.5+mkl-cp36-cp36m-win_amd64.whl"
Processing c:\users\administrator\documents\programfiles\pythonpython3.6.6\scripts\numpy-1.16.5+mkl-cp36-cp36m-win_amd64.whl
Installing collected packages: numpy
Successfully installed numpy-1.16.5+mkl

C:\Users\Administrator\Documents\programFiles\PythonPython3.6.6\Scripts>pip install scipy-1.2.2-cp36-cp36m-win_amd64.whl
Processing c:\users\administrator\documents\programfiles\pythonpython3.6.6\scripts\scipy-1.2.2-cp36-cp36m-win_amd64.whl
Requirement already satisfied: numpy>=1.8.2 in c:\users\administrator\documents\programfiles\pythonpython3.6.6\lib\site-packages (from scipy==1.2.2) (1.16.5+mkl)
Installing collected packages: scipy
Successfully installed scipy-1.2.2

C:\Users\Administrator\Documents\programFiles\PythonPython3.6.6\Scripts>pip install pandas-0.24.2-cp36-cp36m-win_amd64.whl
Processing c:\users\administrator\documents\programfiles\pythonpython3.6.6\scripts\pandas-0.24.2-cp36-cp36m-win_amd64.whl
Collecting pytz>=2011k (from pandas==0.24.2)
  Downloading https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl (509kB)
     |████████████████████████████████| 512kB 56kB/s
Requirement already satisfied: numpy>=1.12.0 in c:\users\administrator\documents\programfiles\pythonpython3.6.6\lib\site-packages (from pandas==0.24.2) (1.16.5+mkl)
Collecting python-dateutil>=2.5.0 (from pandas==0.24.2)
  Downloading https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB)
     |████████████████████████████████| 235kB 78kB/s
Collecting six>=1.5 (from python-dateutil>=2.5.0->pandas==0.24.2)
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: pytz, six, python-dateutil, pandas
Successfully installed pandas-0.24.2 python-dateutil-2.8.0 pytz-2019.3 six-1.12.0

C:\Users\Administrator\Documents\programFiles\PythonPython3.6.6\Scripts>pip install matplotlib-3.1.1-cp36-cp36m-win_amd64.whl
Processing c:\users\administrator\documents\programfiles\pythonpython3.6.6\scripts\matplotlib-3.1.1-cp36-cp36m-win_amd64.whl
Collecting kiwisolver>=1.0.1 (from matplotlib==3.1.1)
  Downloading https://files.pythonhosted.org/packages/64/46/75ab48386cbd56065f5542360562be524ad599911455b6d95520cb118613/kiwisolver-1.1.0-cp36-none-win_amd64.whl (57kB)
     |████████████████████████████████| 61kB 8.1kB/s
Requirement already satisfied: numpy>=1.11 in c:\users\administrator\documents\programfiles\pythonpython3.6.6\lib\site-packages (from matplotlib==3.1.1) (1.16.5+mkl)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib==3.1.1)
  Downloading https://files.pythonhosted.org/packages/11/fa/0160cd525c62d7abd076a070ff02b2b94de589f1a9789774f17d7c54058e/pyparsing-2.4.2-py2.py3-none-any.whl (65kB)
     |████████████████████████████████| 71kB 8.1kB/s
Collecting cycler>=0.10 (from matplotlib==3.1.1)
  Downloading https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
Requirement already satisfied: python-dateutil>=2.1 in c:\users\administrator\documents\programfiles\pythonpython3.6.6\lib\site-packages (from matplotlib==3.1.1) (2.8.0)
Requirement already satisfied: setuptools in c:\users\administrator\documents\programfiles\pythonpython3.6.6\lib\site-packages (from kiwisolver>=1.0.1->matplotlib==3.1.1) (39.0.1)
Requirement already satisfied: six in c:\users\administrator\documents\programfiles\pythonpython3.6.6\lib\site-packages (from cycler>=0.10->matplotlib==3.1.1) (1.12.0)
Installing collected packages: kiwisolver, pyparsing, cycler, matplotlib
Successfully installed cycler-0.10.0 kiwisolver-1.1.0 matplotlib-3.1.1 pyparsing-2.4.2

C:\Users\Administrator\Documents\programFiles\PythonPython3.6.6\Scripts>pip show pip
Name: pip
Version: 19.2.3
Summary: The PyPA recommended tool for installing Python packages.
Home-page: https://pip.pypa.io/
Author: The pip developers
Author-email: [email protected]
License: MIT
Location: c:\users\administrator\documents\programfiles\pythonpython3.6.6\lib\site-packages
Requires:
Required-by:

C:\Users\Administrator\Documents\programFiles\PythonPython3.6.6\Scripts>
发布了14 篇原创文章 · 获赞 0 · 访问量 641

猜你喜欢

转载自blog.csdn.net/goodgoodstudyddp/article/details/102452699