适用于 freetype、png 包的 Windows 7 上的 Python matplotlib 安装问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39060669/
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 matplotlib install issue on Windows 7 for freetype, png packages
提问by Lin Ma
Using Python 2.7 on Windows 7. Here is the command I am using to install and error message. Wondering if anyone have met with similar issues before? Thanks.
在 Windows 7 上使用 Python 2.7。这是我用来安装和错误消息的命令。想知道以前有没有人遇到过类似的问题?谢谢。
C:\Python27\Scripts>pip install matplotlib
Collecting matplotlib
Downloading matplotlib-1.5.2.tar.gz (51.6MB)
100% |################################| 51.6MB 19kB/s
Complete output from command python setup.py egg_info:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.2]
python: yes [2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015,
20:40:30) [MSC v.1500 64 bit (AMD64)]]
platform: yes [win32]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.11.1]
dateutil: yes [dateutil was not found. It is required for date
axis support. pip/easy_install may attempt to
install it after matplotlib.]
pytz: yes [pytz was not found. pip will attempt to install
it after matplotlib.]
cycler: yes [cycler was not found. pip will attempt to
install it after matplotlib.]
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 [pyparsing was not found. It is required for
mathtext support. pip/easy_install may attempt to
install it after matplotlib.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: no [The C/C++ header for freetype (ft2build.h)
could not be found. You may need to install the
development package.]
png: no [The C/C++ header for png (png.h) could not be
found. You may need to install the development
package.]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite. Please install it with pip or
your preferred tool to run the test suite / mock is
required to run the matplotlib test suite. Please
install it with pip or your preferred tool to run
the test suite]
toolkits_tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite. Please install it with pip or
your preferred tool to run the test suite / mock is
required to run the matplotlib test suite. Please
install it with pip or your preferred tool to run
the test suite]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt5agg: no [PyQt5 not found]
qt4agg: no [PySide not found; PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: yes [installing; run-time loading from Python Tcl /
Tk]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: yes [installing]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: no
latex: no
pdftops: no
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype, png
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\foo\a
ppdata\local\temp\pip-build-zxfsow\matplotlib\
采纳答案by be_good_do_good
http://www.lfd.uci.edu/~gohlke/pythonlibs/
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Get matplotlib from above location. Choose correct package based on python(2.x/3.x) and bit(32/64) version.
从上面的位置获取 matplotlib。根据 python(2.x/3.x) 和 bit(32/64) 版本选择正确的包。
32-bit 2.7: matplotlib-1.5.2-cp27-cp27m-win32.whl
64-bit 2.7: matplotlib-1.5.2-cp27-cp27m-win_amd64.whl
If you face any issues in the middle, please refer to below link: https://stackoverflow.com/a/38618044/5334188
如果您在中间遇到任何问题,请参考以下链接:https: //stackoverflow.com/a/38618044/5334188
回答by Doron Gombosh
I solved it by taking version 1.5.1
我通过使用 1.5.1 版解决了它
pip install matplotlib==1.5.1
it seems that version 1.5.2 installer is broken.
似乎 1.5.2 版安装程序已损坏。
回答by Ryan B.
As you can see it png
and freetype
modules are missing. You need to install them separately.
正如你可以看到它png
和freetype
模块丢失。您需要单独安装它们。
Try doing the following :
尝试执行以下操作:
> pip install freetype-py
> pip install pypng
> pip install matplotlib
回答by E.Mich
I had the exact same issue.
我有完全相同的问题。
Seems that my pip was v7 which is old. upgraded to v9 with the 'upgrade' button. then tried to install matplotlib again and was successful this time.
似乎我的 pip 是旧的 v7。使用“升级”按钮升级到 v9。然后再次尝试安装matplotlib,这次成功了。
maybe this helps
也许这有帮助
回答by Mark
I came across the same problem with you, and here is my solution
我和你遇到了同样的问题,这是我的解决方案
It has the problem with python 3.6 integrated with the newest pip. so I installed python 3.5.2 with pip, but do not upgrade pip. And you can get matplotlib installed in this way.
与最新的 pip 集成的 python 3.6 存在问题。所以我用pip安装了python 3.5.2,但不升级pip。您可以通过这种方式安装 matplotlib。
Hope I could provide a possible solution
希望我能提供一个可能的解决方案
回答by Süleyman Efendi
I solved the same problem in W?ndows 10 as folowing:
我在 W?ndows 10 中解决了同样的问题,如下所示:
1- Download the following files for win32 or win64 python3.7:
1-为win32或win64 python3.7下载以下文件:
matplotlib-2.2.2-cp27-cp37m-win32.whl
or
或者
matplotlib-2.2.2-cp27-cp37m-win_amd64.whl
from the https://www.lfd.uci.edu/~gohlke/pythonlibs/
来自https://www.lfd.uci.edu/~gohlke/pythonlibs/
2- By cmd console run the downloaded file under python:
2-通过cmd控制台在python下运行下载的文件:
.\Downloads> python -m pip install matplotlib-2.2.2-cp37-cp37m-win_amd64.whl
you can try the matplolib
你可以试试 matplolib
回答by itsmygreencactus
I had this problem today with Python 3.8.0
and the installation was successfully with matplotlib==3.2.0rc1
after I installed freetype-py
.
我今天遇到了这个问题Python 3.8.0
,安装matplotlib==3.2.0rc1
后安装成功freetype-py
。