weixin_39673947
weixin_39673947
2020-12-26 10:15

安装imread出现错误

环境 win10 Python3.7 pycharm

安装imread出现问题

imread/lib/_jpeg.cpp(10): fatal error C1083: Cannot open include file: 'jpeglib.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/ Collecting imread Using cached https://pypi.tuna.tsinghua.edu.cn/packages/4e/7e/52603151a6746a229f80b3d22a08e468dce9bcf723728a3b99d050372e86/imread-0.7.1.tar.gz Requirement already satisfied: numpy in d:\program files\python37\lib\site-packages (from imread) (1.17.2) Installing collected packages: imread Running setup.py install for imread: started Running setup.py install for imread: finished with status 'error' Complete output from command "D:\Program Files\Python37\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\Administrator\AppData\Local\Temp\pycharm-packaging\imread\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Administrator\AppData\Local\Temp\pip-record-jldkfk24\install-record.txt --single-version-externally-managed --compile: 'pkg-config' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 running install running build running build_py creating build creating build\lib.win-amd64-3.7 creating build\lib.win-amd64-3.7\imread copying imread\ijrois.py -> build\lib.win-amd64-3.7\imread copying imread\imread.py -> build\lib.win-amd64-3.7\imread copying imread\imread_version.py -> build\lib.win-amd64-3.7\imread copying imread\special.py -> build\lib.win-amd64-3.7\imread copying imread__init__.py -> build\lib.win-amd64-3.7\imread creating build\lib.win-amd64-3.7\imread\tests copying imread\tests\test_bmp.py -> build\lib.win-amd64-3.7\imread\tests copying imread\tests\test_error.py -> build\lib.win-amd64-3.7\imread\tests copying imread\tests\test_formats.py -> build\lib.win-amd64-3.7\imread\tests copying imread\tests\test_imread.py -> build\lib.win-amd64-3.7\imread\tests copying imread\tests\test_imread_from_blob.py -> build\lib.win-amd64-3.7\imread\tests copying imread\tests\test_imsave.py -> build\lib.win-amd64-3.7\imread\tests copying imread\tests\test_jpeg.py -> build\lib.win-amd64-3.7\imread\tests copying imread\tests\test_png.py -> build\lib.win-amd64-3.7\imread\tests copying imread\tests\test_rois.py -> build\lib.win-amd64-3.7\imread\tests copying imread\tests\test_tiff.py -> build\lib.win-amd64-3.7\imread\tests copying imread\tests\test_webp.py -> build\lib.win-amd64-3.7\imread\tests copying imread\tests\test_xcf.py -> build\lib.win-amd64-3.7\imread\tests copying imread\tests__init__.py -> build\lib.win-amd64-3.7\imread\tests creating build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\0186-0099.roi -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\1_webp_a.webp -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\arange512_16bit.png -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\bit1.png -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\diag.xcf -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\error.jpg -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\error.png -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\error.tif -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\error.unknown -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\error.webp -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\ghsystem_flame.jpg -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\good -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\good.png -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\mono.tif -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\palette_zero.png -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\py-installer-indexed.bmp -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\rgba.png -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\rois.zip -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\stack.tiff -> build\lib.win-amd64-3.7\imread\tests\data copying imread\tests\data\star1.bmp -> build\lib.win-amd64-3.7\imread\tests\data warning: build_py: byte-compiling is disabled, skipping.

running build_ext
building 'imread._imread' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\imread
creating build\temp.win-amd64-3.7\Release\imread\lib
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 "-ID:\Program Files\Python37\include" "-ID:\Program Files\Python37\include" "-ID:\Program Files\Python37\lib\site-packages\numpy\core\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /EHsc /Tpimread/_imread.cpp /Fobuild\temp.win-amd64-3.7\Release\imread/_imread.obj
_imread.cpp
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/base.h(95): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/base.h(212): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/base.h(221): warning C4146: unary minus operator applied to unsigned type, result still unsigned
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/base.h(221): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/file.h(20): warning C4996: 'close': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _close. See online help for details.
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_io.h(457): note: see declaration of 'close'
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/file.h(23): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/file.h(23): warning C4996: 'read': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _read. See online help for details.
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_io.h(521): note: see declaration of 'read'
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/file.h(26): warning C4267: 'argument': conversion from 'size_t' to 'long', possible loss of data
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/file.h(26): warning C4996: 'lseek': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _lseek. See online help for details.
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_io.h(501): note: see declaration of 'lseek'
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/file.h(27): warning C4996: 'lseek': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _lseek. See online help for details.
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_io.h(501): note: see declaration of 'lseek'
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/file.h(28): warning C4996: 'lseek': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _lseek. See online help for details.
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_io.h(501): note: see declaration of 'lseek'
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/file.h(32): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/file.h(32): warning C4996: 'write': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _write. See online help for details.
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_io.h(556): note: see declaration of 'write'
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/numpy.h(75): warning C4244: 'return': conversion from 'npy_intp' to 'int', possible loss of data
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib/numpy.h(114): warning C4244: 'argument': conversion from 'npy_intp' to 'int', possible loss of data
imread/_imread.cpp(100): warning C4267: 'argument': conversion from 'size_t' to 'const int', possible loss of data
imread/_imread.cpp(104): warning C4996: 'open': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _open. See online help for details.
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_io.h(514): note: see declaration of 'open'
imread/_imread.cpp(134): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
imread/_imread.cpp(163): warning C4800: 'ImageFormat *': forcing value to bool 'true' or 'false' (performance warning)
imread/_imread.cpp(297): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data
imread/_imread.cpp(297): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'const unsigned int', possible loss of data
imread/_imread.cpp(286): warning C4996: 'open': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _open. See online help for details.
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\corecrt_io.h(514): note: see declaration of 'open'
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 "-ID:\Program Files\Python37\include" "-ID:\Program Files\Python37\include" "-ID:\Program Files\Python37\lib\site-packages\numpy\core\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /EHsc /Tpimread/lib/formats.cpp /Fobuild\temp.win-amd64-3.7\Release\imread/lib/formats.obj
formats.cpp
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(95): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(212): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(221): warning C4146: unary minus operator applied to unsigned type, result still unsigned
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(221): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 "-ID:\Program Files\Python37\include" "-ID:\Program Files\Python37\include" "-ID:\Program Files\Python37\lib\site-packages\numpy\core\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /EHsc /Tpimread/lib/numpy.cpp /Fobuild\temp.win-amd64-3.7\Release\imread/lib/numpy.obj
numpy.cpp
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(95): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(212): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(221): warning C4146: unary minus operator applied to unsigned type, result still unsigned
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(221): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\numpy.h(75): warning C4244: 'return': conversion from 'npy_intp' to 'int', possible loss of data
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\numpy.h(114): warning C4244: 'argument': conversion from 'npy_intp' to 'int', possible loss of data
imread/lib/numpy.cpp(8): warning C4244: 'initializing': conversion from 'npy_intp' to 'int', possible loss of data
imread/lib/numpy.cpp(8): warning C4244: 'initializing': conversion from 'npy_intp' to 'const int', possible loss of data
imread/lib/numpy.cpp(9): warning C4244: 'initializing': conversion from 'npy_intp' to 'int', possible loss of data
imread/lib/numpy.cpp(9): warning C4244: 'initializing': conversion from 'npy_intp' to 'const int', possible loss of data
imread/lib/numpy.cpp(14): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
imread/lib/numpy.cpp(17): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 "-ID:\Program Files\Python37\include" "-ID:\Program Files\Python37\include" "-ID:\Program Files\Python37\lib\site-packages\numpy\core\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /EHsc /Tpimread/lib/_bmp.cpp /Fobuild\temp.win-amd64-3.7\Release\imread/lib/_bmp.obj
_bmp.cpp
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(95): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(212): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(221): warning C4146: unary minus operator applied to unsigned type, result still unsigned
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(221): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\tools.h(23): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 "-ID:\Program Files\Python37\include" "-ID:\Program Files\Python37\include" "-ID:\Program Files\Python37\lib\site-packages\numpy\core\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /EHsc /Tpimread/lib/_jpeg.cpp /Fobuild\temp.win-amd64-3.7\Release\imread/lib/_jpeg.obj
_jpeg.cpp
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(95): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(212): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(221): warning C4146: unary minus operator applied to unsigned type, result still unsigned
c:\users\administrator\appdata\local\temp\pycharm-packaging\imread\imread\lib\base.h(221): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
imread/lib/_jpeg.cpp(10): fatal error C1083: Cannot open include file: 'jpeglib.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

----------------------------------------

Command ""D:\Program Files\Python37\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\Administrator\AppData\Local\Temp\pycharm-packaging\imread\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Administrator\AppData\Local\Temp\pip-record-jldkfk24\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Administrator\AppData\Local\Temp\pycharm-packaging\imread\ You are using pip version 19.0.3, however version 19.2.3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

该提问来源于开源项目:Maicius/QQZoneMood

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39829166 weixin_39829166 4月前

    使用PIL代替了scipy里的imread,已解决。 scipy中的imread版本比较老,安装确实不方便

    点赞 1 评论 复制链接分享
  • weixin_39673947 weixin_39673947 4月前

    安装其他模块没有这问题,找不到解决办法.也是小白一枚,谢谢了

    点赞 评论 复制链接分享
  • weixin_39829166 weixin_39829166 4月前

    建议你先试下docker版本的安装,windows 10上我这边测试起来比较麻烦

    点赞 评论 复制链接分享
  • weixin_39673947 weixin_39673947 4月前

    好的,谢谢.

    点赞 评论 复制链接分享
  • weixin_39752352 weixin_39752352 4月前

    同 imread出现错误,centos7,Python3.6.8 GCC和Python-dev都安装过了。

    `imread/lib/_tiff.cpp:15:23: fatal error: tiffio.h: No such file or directory #include ^ compilation terminated. error: command 'gcc' failed with exit status 1

    ----------------------------------------
    

    Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-551akyuv/imread/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-th3nuklf-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-551akyuv/imread/`

    点赞 评论 复制链接分享

相关推荐