在cmd中设置网络代理并安装numpy、matplotlib

最近由于工作需要,需要在windows中安装python和相关库文件,但是电脑接入了区域内网,使用了统一网络代理。在cmd中安装python3.6较为顺利,但安装numpy和matplotlib时一直报错:

ERROR: Could not find a version that satisfied the requirements numpy

ERROR: No matching distribution found for numpy.

解决办法如下

1、转接proxy权限

        管理员身份打开cmd,设置

set http_proxy = http://username:password@example.com:8080
set https_proxy = http://username:password@example.com:8080

        注意,password不能出现特殊字符,如“!@#¥%-+&* ”等,如果出现,需要用ASCII码进行替代,参考 https://blog.csdn.net/pcyph/article/details/45010609

         然后使用如下命令检验是否转接成功

curl http://google.com
curl https://google.com

        如果验证https时出错,可以加--ssl-no-revoke检查

2、安装

python -m pip install numpy --user --trusted-host pypi.org --trusted-host files
python -m pip install matplotlib --user --trusted-host pypi.org --trusted-host files

        安装成功。

测试参考:

https://www.runoob.com/numpy/numpy-install.html 

https://www.runoob.com/matplotlib/matplotlib-install.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值