简体   繁体   English

致命错误 LNK1181:安装 matplotlib==3.0.3 时无法打开输入文件“png.lib”

[英]Fatal Error LNK1181: cannot open input file 'png.lib' while installing matplotlib==3.0.3

I have been trying to install matplotlib==3.0.3 in a conda environment.我一直在尝试在 conda 环境中安装 matplotlib==3.0.3。 I have installed MS Visual Build tools for C++ and added rc.exe and rcdll.dll to bin folder in Microsoft Visual Studio 14.0.我已经为 C++ 安装了 MS Visual Build 工具,并将 rc.exe 和 rcdll.dll 添加到 Microsoft Visual Studio 14.0 的 bin 文件夹中。 Please take a look and help me out.请看一下并帮助我。

 Complete output (56 lines):
    ============================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
                matplotlib: yes [3.0.3]
                    python: yes [3.8.3 (default, Jul  2 2020, 17:30:36) [MSC
                            v.1916 64 bit (AMD64)]]
                  platform: yes [win32]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.18.5]
          install_requires: yes [handled by setuptools]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
                  freetype: yes [Using unknown version found on system.]
                       png: yes [Using unknown version found on system.]
                     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
                       agg: yes [installing]
                     tkagg: yes [installing; run-time loading from Python Tcl /
                            Tk]
                    macosx: no  [Mac OS-X only]
                 windowing: yes [installing]

    OPTIONAL PACKAGE DATA
                      dlls: no  [skipping due to configuration]

    running install
    running build
    running build_py
    copying lib\matplotlib\mpl-data\matplotlibrc -> build\lib.win-amd64-3.8\matplotlib\mpl-data
    UPDATING build\lib.win-amd64-3.8\matplotlib\_version.py
    set build\lib.win-amd64-3.8\matplotlib\_version.py to '3.0.3'
    running build_ext
    building 'matplotlib._png' extension
    creating build\temp.win-amd64-3.8
    creating build\temp.win-amd64-3.8\Release
    creating build\temp.win-amd64-3.8\Release\src
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib__png_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -IC:\Anaconda3\envs\rev_env\lib\site-packages\numpy\core\include -IC:\Anaconda3\envs\rev_env\Library\include -I. -IC:\Anaconda3\envs\rev_env\include -IC:\Anaconda3\envs\rev_env\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpsrc/_png.cpp /Fobuild\temp.win-amd64-3.8\Release\src/_png.obj
    _png.cpp
    src/_png.cpp(336): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int', possible loss of data
    src/_png.cpp(318): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1769): note: see declaration of 'sprintf'
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib__png_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -IC:\Anaconda3\envs\rev_env\lib\site-packages\numpy\core\include -IC:\Anaconda3\envs\rev_env\Library\include -I. -IC:\Anaconda3\envs\rev_env\include -IC:\Anaconda3\envs\rev_env\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpsrc/mplutils.cpp /Fobuild\temp.win-amd64-3.8\Release\src/mplutils.obj
    mplutils.cpp
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Anaconda3\envs\rev_env\Library\lib /LIBPATH:C:\Anaconda3\envs\rev_env\libs /LIBPATH:C:\Anaconda3\envs\rev_env\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" png.lib z.lib /EXPORT:PyInit__png build\temp.win-amd64-3.8\Release\src/_png.obj build\temp.win-amd64-3.8\Release\src/mplutils.obj /OUT:build\lib.win-amd64-3.8\matplotlib\_png.cp38-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.8\Release\src\_png.cp38-win_amd64.lib
    LINK : fatal error LNK1181: cannot open input file 'png.lib'
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1181

I hope you found a solution, but if not, here is one: accourding to the matplot source code here , on windows you probably should create z.lib and png.lib somewhere, then set the LINK environment variable to point to them.我希望您找到了解决方案,但如果没有,这里有一个:根据此处的 matplot 源代码,在 windows 上,您可能应该在某处创建 z.lib 和 png.lib,然后将 LINK 环境变量设置为指向它们。

 If not using pkg-config (in particular on Windows), you may need to set the
   include path (to the FreeType, libpng, and zlib headers) and link path (to
   the FreeType, libpng, and zlib libraries) explicitly, if they are not in
   standard locations.  This can be done using standard environment variables
   and on Windows:

   .. code-block:: bat

      set CL=/IC:\directory\containing\ft2build.h ...
      set LINK=/LIBPATH:C:\directory\containing\freetype.lib ...

   where ``...`` means "also give, in the same format, the directories
   containing ``png.h`` and ``zlib.h`` for the include path, and for
   ``libpng.so``/``png.lib`` and ``libz.so``/``z.lib`` for the link path."

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 链接:致命错误LNK1181:无法打开输入文件'gpuarray.lib' - LINK : fatal error LNK1181: cannot open input file 'gpuarray.lib' 链接:致命错误 LNK1181:无法打开输入文件“db2cli64.lib” - LINK : fatal error LNK1181: cannot open input file 'db2cli64.lib' 在目录['lib']中找不到库'radial'...链接:致命错误LNK1181:无法打开输入文件'radial.lib' - could not find library 'radial' in directories ['lib']…LINK : fatal error LNK1181: cannot open input file 'radial.lib' LNK1181: 无法打开输入文件“m.lib” - LNK1181: cannot open input file 'm.lib' 无法构建boost_python示例代码“致命错误LNK1181:无法打开输入文件'boost_python.lib'” - Failed to build boost_python example code “fatal error LNK1181: cannot open input file 'boost_python.lib'” KivEnt安装:致命错误LNK1181无法打开输入文件'glew32.lib' - KivEnt installation: Fatal error LNK1181 can't open input file 'glew32.lib' 链接:致命错误 lnk1181:无法打开输入文件 'id=2.obj' - LINK: fatal error lnk1181: cannot open input file 'id=2.obj' 链接:致命错误LNK1181:为python安装scikits.bvp_solver模块时无法打开输入文件'mingw32.lib' - LINK: fatal error LNK1181: cannot open input file 'mingw32.lib' when install scikits.bvp_solver module for python 使用cython构建错误| LINK:致命错误 LNK1181 - Build error using cython | LINK : fatal error LNK1181 Boost : 致命错误 LNK1104: 无法打开文件 (lib) - Boost : fatal error LNK1104: cannot open file (lib)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM