Python模块安装包的安装问题(numpy,matpolitlib)

鉴于我成功安装numpy模块安装包用了近半个月的时间(当然途中有过放弃),今天终于成功安装,分享一下个人失败教训和心得。

  *注意:下面的代码需要读者操作的只需第一行,其他行为第一行的执行过程和结果

我参考的安装路径大致如下:

1.numpy的安装

点击numpy安装网站
如图,找到适合自己版本的模块文件
在这里插入图片描述
cp是指Python的版本,win等是表示操作系统,32,64则是表示系统的位数。(我的电脑是32位的,之前由于不太了解,一直以为是64的,所以前期一直安装不上)
将下载文件保存到一定位置后,打开命令框(同时按系统键(win系统键盘是四个小方块)和R),输入cmd,打开命令框后在命令行输入:pip install ‘numpy文件路径’ 如下图所示:

示例如下:

Microsoft Windows [版本 10.0.17763.253]
(c) 2018 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>pip install D:\numpy\Numpy\numpy-2.2.4-cp35-cp35m-win32.whl


点下回车就可以了!

2.matplotlib

下载matplotlib的网站:matplotlib下载网站
一般先需要升及以下自己的pip,具体步骤如下:

C:\Users\Administrator>python -m pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
    100% |████████████████████████████████| 1.4MB 265kB/s
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-19.3.1

升级完后进行安装操作:
第一步:安装pip相应安装工具:

C:\Users\Administrator>python -m pip install -U pip setuptools
Requirement already up-to-date: pip in c:\users\administrator\appdata\local\programs\python\python35-32\lib\site-packages (19.3.1)
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/9e/d5/444a443d890f09fc1ca1a2c3c9fc7e84cb148177b05ac94fe5084e3d9abb/setuptools-42.0.1-py2.py3-none-any.whl (582kB)
     |████████████████████████████████| 583kB 43kB/s
Installing collected packages: setuptools
  Found existing installation: setuptools 28.8.0
    Uninstalling setuptools-28.8.0:
      Successfully uninstalled setuptools-28.8.0
Successfully installed setuptools-42.0.1

第二步:安装matplotlib模块:

C:\Users\Administrator>python -m pip install matplotlib
Collecting matplotlib
  Downloading https://files.pythonhosted.org/packages/ac/38/1dac102a8febac496b977fac01d659cc546d03908b503bcd0417115e338d/matplotlib-3.0.3-cp35-cp35m-win32.whl (8.8MB)
     |████████████████████████████████| 8.8MB 409kB/s
Requirement already satisfied: numpy>=1.10.0 in c:\users\administrator\appdata\local\programs\python\python35-32\lib\site-packages (from matplotlib) (1.17.4)
Collecting python-dateutil>=2.1
  Downloading https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227kB)
     |████████████████████████████████| 235kB 1.1MB/s
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1
  Downloading https://files.pythonhosted.org/packages/c0/0c/fc2e007d9a992d997f04a80125b0f183da7fb554f1de701bbb70a8e7d479/pyparsing-2.4.5-py2.py3-none-any.whl (67kB)
     |████████████████████████████████| 71kB 770kB/s
Collecting cycler>=0.10
  Downloading https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
Collecting kiwisolver>=1.0.1
  Downloading https://files.pythonhosted.org/packages/66/c8/5800451b96689d61da8a2de4a7123086b5d14a58642ee1ee487d19a63e07/kiwisolver-1.1.0-cp35-none-win32.whl (44kB)
     |████████████████████████████████| 51kB 126kB/s
Collecting six>=1.5
  Downloading https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in c:\users\administrator\appdata\local\programs\python\python35-32\lib\site-packages (from kiwisolver>=1.0.1->matplotlib) (42.0.1)
Installing collected packages: six, python-dateutil, pyparsing, cycler, kiwisolver, matplotlib
Successfully installed cycler-0.10.0 kiwisolver-1.1.0 matplotlib-3.0.3 pyparsing-2.4.5 python-dateutil-2.8.1 six-1.13.0


这样基本就差不多OK。
推荐以下两篇博客,可能能够帮助你更深入理解:(下面两篇文章可能numpy和matplotlib都介绍了,但从个人角度(根据我个人的能力水平和接受程度)建议读者分别参考链接标注内容的相关信息)
numpy安装博客
matplotlib安装教程

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值