pip安装错误,缺少freetype和libpng (Windows)

问题描述 投票:0回答:1

我从github下载了一个repo,并试图在venv中安装需求。它告诉我缺少freetype和libpng库,所以我去网站上安装了它们。然而我还是被告知缺少这两个库。(当然是在重启之后)

这是日志中的错误。

Collecting matplotlib==2.2.2
  Using cached matplotlib-2.2.2.tar.gz (37.3 MB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\programming\python\example programs\deepfake\venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\garym\\AppData\\Local\\Temp\\pip-install-ppn3h81t\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\garym\\AppData\\Local\\Temp\\pip-install-ppn3h81t\\matplotlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\garym\AppData\Local\Temp\pip-install-ppn3h81t\matplotlib\pip-egg-info'
         cwd: C:\Users\garym\AppData\Local\Temp\pip-install-ppn3h81t\matplotlib\
    Complete output (61 lines):
    ============================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
                matplotlib: yes [2.2.2]
                    python: yes [3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019,
                            19:21:23) [MSC v.1916 32 bit (Intel)]]
                  platform: yes [win32]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [not found. pip may install it below.]
          install_requires: yes [handled by setuptools]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
                  freetype: no  [The C/C++ header for freetype
                            (freetype2\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 'libqhull' could not
                            be found. Using local copy.]

    OPTIONAL SUBPACKAGES
               sample_data: yes [installing]
                  toolkits: yes [installing]
                     tests: no  [skipping due to configuration]
            toolkits_tests: no  [skipping due to configuration]

    OPTIONAL BACKEND EXTENSIONS
                    macosx: no  [Mac OS-X only]
                    qt5agg: no  [PySide2 not found; 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
                            * Please check http://gnuwin32.sourceforge.net/packa
                            * ges/freetype.htm for instructions to install
                            * freetype
                            * Please check http://gnuwin32.sourceforge.net/packa
                            * ges/libpng.htm for instructions to install png
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

和这里的问题一样Matplotlib安装问题. Pip Centos - 安装时Freetype "缺失"

不过我是在Windows系统上,所以这个解决方案不适用。

我相信这个解决方案是说这个用户需要安装freetype开发头文件,这些和 "源文件 "一样吗,即安装freetype的可选部分?如果是的话,我已经下载了它们,但不知道放在哪里。有 manifestsrc 目录。

windows pip install freetype2
1个回答
0
投票

由 FlyingTeller 在评论中回答。解决方法是用Python 3.7 64位的venv就可以了。

© www.soinside.com 2019 - 2024. All rights reserved.