我正在尝试在Ubuntu Linux上的virtualenv中使用pip安装matplotlib。我已经成功安装了一堆软件包 - 这是一个失败的软件包。正如输出所示,这是python 2.7.3并且所有依赖项都已存在。
这是否特定于matplotlib的v1.4.3?我应该安装早期版本吗?我甚至手动安装了mock(v1.3.0),因为安装似乎在尝试导入时失败了,但这也无济于事。
这是输出: 收集matplotlib 使用缓存的matplotlib-1.4.3.tar.gz 从命令python setup.py egg_info完成输出: ================================================== ========================== 编辑setup.cfg以更改构建选项
BUILDING MATPLOTLIB
matplotlib: yes [1.4.3]
python: yes [2.7.3 (default, Jun 22 2015, 19:33:41) [GCC
4.6.3]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.9.2]
six: yes [using six version 1.9.0]
dateutil: yes [using dateutil version 2.4.2]
pytz: yes [using pytz version 2015.4]
tornado: yes [tornado was not found. It is required for the
WebAgg backend. pip/easy_install may attempt to
install it after matplotlib.]
pyparsing: yes [using pyparsing version 2.0.3]
pycxx: yes [Couldn't import. Using local copy.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: yes [version 2.4.8]
png: yes [version 1.2.46]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-mHyI6G/matplotlib/setup.py", line 155, in <module>
result = package.check()
File "setupext.py", line 666, in check
import mock
File "/home/awarnock/PyProjects/OMTO3dIMG/local/lib/python2.7/site-packages/mock/__init__.py", line 2, in <module>
import mock.mock as _mock
File "/home/awarnock/PyProjects/OMTO3dIMG/local/lib/python2.7/site-packages/mock/mock.py", line 71, in <module>
_v = VersionInfo('mock').semantic_version()
AttributeError: 'VersionInfo' object has no attribute 'semantic_version'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip- build-mHyI6G/matplotlib
提前感谢任何建议。
答案 0 :(得分:0)
您可以尝试:
pip install oslo.utils
或者:
pip install testrepository
pip install oslo.utils
您也可以使用软件包安装它:
Debian / Ubuntu:
apt-get install python-matplotlib
Redhat / CentOS:
yum install python-matplotlib