【发布时间】:2018-11-12 07:47:35
【问题描述】:
我想通过 pip 安装 matplotlib 时遇到问题:
我做到了:
$ sudo pip install matplotlib
输出:
Requirement already satisfied: matplotlib in /usr/lib/python2.7/dist-packages (1.5.1)
launchpadlib 1.10.3 requires testresources, which is not installed.
paramiko 2.4.1 has requirement cryptography>=1.5, but you'll have cryptography 1.2.3 which is incompatible.
然后我做了:
$ sudo pip install cryptography
输出:与上述相同的错误。
部分代码:
import sys
print(sys.version)
import matplotlib.pyplot as plt
输出:
2.7.12 (default, Dec 4 2017, 14:50:18)
Traceback (most recent call last):
[GCC 5.4.0 20160609]
import matplotlib.pyplot as plt
ImportError: No module named matplotlib.pyplot
我该怎么办?
提前致谢。
【问题讨论】:
-
你试过
sudo pip install -r matplotlib吗? -
尝试使用
pip install matplotlib --upgrade升级包 -
@AliYılmaz 我更新了我的问题。
-
您正在安装到 python 2。您确定您运行的是 python 2 而不是 3?试试
pip3 install matplotlib。我没有大量使用 Linux,但sudo没有安装到可能与特定用户版本不同的 Python 版本? -
@PRMoureu 我做到了,但问题没有解决。
标签: python ubuntu matplotlib cryptography pip