python mpl_toolkits 安装问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37661119/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
python mpl_toolkits installation issue
提问by Vladyslav Nikolaiev
After command pip install mpl_toolkits
I receive next error:
命令后pip install mpl_toolkits
我收到下一个错误:
Could not find a version that satisfies the requirement mpl_toolkits (from versions: )
No matching distribution found for mpl_toolkits
找不到满足 mpl_toolkits 要求的版本(来自版本:)
找不到 mpl_toolkits 的匹配分布
I tried to google, but nothing helps. How can I solve this?
我试图谷歌,但没有任何帮助。我该如何解决这个问题?
回答by alecxe
It is not on PyPI and you should not be installing it via pip
. If you have matplotlib
installed, you should be able to import mpl_toolkits
directly:
它不在 PyPI 上,您不应该通过pip
. 如果你已经matplotlib
安装,你应该可以mpl_toolkits
直接导入:
$ pip install --upgrade matplotlib
...
$ python
>>> import mpl_toolkits
>>>
回答by Charlie Lutaud
It doesn't work on Ubuntu 16.04, it seems that some libraries have been forgotten in the python installation package on this one. You should use package manager instead.
它在Ubuntu 16.04上不起作用,这似乎是在 python 安装包中忘记了一些库。您应该改用包管理器。
Solution
解决方案
Uninstall matplotlibfrom pipthen install it again with apt-get
从pip卸载matplotlib,然后使用apt-get重新安装
python 2:
蟒蛇2:
sudo pip uninstall matplotlib
sudo apt-get install python-matplotlib
python 3:
蟒蛇3:
sudo pip3 uninstall matplotlib
sudo apt-get install python3-matplotlib
回答by Giulio Imperato
if anyone has a problem on Mac, can try this
如果有人在 Mac 上有问题,可以试试这个
sudo pip install --upgrade matplotlib --ignore-installed six
回答by Jerry Sun
I can't comment due to the lack of reputation, but if you are on arch linux, you should be able to find the corresponding libraries on the arch repositories directly. For example for mpl_toolkits.basemap
:
由于缺乏声誉,我无法发表评论,但是如果您使用的是 arch linux,则应该可以直接在 arch 存储库中找到相应的库。例如对于mpl_toolkits.basemap
:
pacman -S python-basemap