之前Python已经安装过matplotlib 并且也能用,但是不知道自己做过什么操作就不能用了。
于是
pip install matplotlib
提示该错误:
PermissionError: [WinError 5] 拒绝访问。: ‘d:\anaconda3\envs\python36\lib\site-packages\numpy\core\multiarray.cp36-win_amd64.pyd’
You are using pip version 9.0.1, however version 21.0.1 is available.
You should consider upgrading via the ‘python -m pip install --upgrade pip’ command.
应该是pip版本需要更新
于是:
python -m pip install --upgrade pip
再输入
pip install matplotlib
依旧提示错误:
ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: ‘d:\anaconda3\envs\python36\lib\site-packages\~umpy\core\multiarray.cp36-win_amd64.pyd’
Consider using the --user
option or check the permissions.
改成如下语句:
pip install --user --upgrade matplotlib
成功
没搞清原因可能是matplotlib版本更新上的。。。
希望对大家有帮助,xuexue