目录
4、执行pip install遇到 Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。
1、遇到的问题:
jupyter notebook使用matplotlib库时,出现
You probably need to get an updated matplotlibrc file from
绘图完全没有问题,只是这样看着实在难受,所以解决一下。
2、原因:
matplotlib库的版本过低造成的。
3、解决办法:
对matplotlib进行更新:
1、使用python自带的pip更新:
pip install --upgrade matplotlib
或者在包后面加==3.5.1等等版本号来指定版本。
pip install –upgrade matplotlib==3.5.1
由于安装python时安装了环境变量,所以可以直接windows+r进入cmd输入命令。如下图:
2、conda更新包:
conda update matplotlib
同样可以指定版本:conda install matplotlib=3.5.1
注意:等号(=)后面是版本号。
4、执行pip install遇到 Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: ‘C:\Users\86157\AppData\Local\Temp\pip-uninstall-0jdje1cp\matplotlib\backends\_backend_agg.cp37-win_amd64.pyd’
Consider using the --user
option or check the permissions.
解决办法:
添加–user选项赋予权限:
python -m pip install --upgrade pip -i https://pypi.douban.com/simple --user
我这里直接在更新命令下添加–user
5、验证查看:(库的版本和位置)
查看matplotlib/numpy库的版本:
使用命令进行查询。需要首先进入python环境,然后在进行查询。
- 查询numpy版本
import numpy
print(numpy.__version__)
或者
print(numpy.version.version)
- 查询numpy安装位置
import numpy
print(numpy.__file__)
Original: https://blog.csdn.net/weixin_46474921/article/details/123783093
Author: Siobhan. 明鑫
Title: python中matplotlib:updated matplotlibrc file、查看库的版本和位置、EnvironmentError: [WinError 5]
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/764652/
转载文章受原作者版权保护。转载请注明原作者出处!