代码之家  ›  专栏  ›  技术社区  ›  Kush Agrawal

在python中使用pip安装“stasm”时出错

  •  0
  • Kush Agrawal  · 技术社区  · 2 年前

    我试图在Python中使用pip安装stasm,但出现以下错误。

    C:\Users\Kush>pip install stasm
    Collecting stasm
      Using cached stasm-2.0.2.tar.gz (688 kB)
      Preparing metadata (setup.py) ... done
    Requirement already satisfied: numpy>=1.10 in c:\users\kush\appdata\local\programs\python\python38\lib\site-packages (from stasm) (1.22.2)
    Using legacy 'setup.py install' for stasm, since package 'wheel' is not installed.
    Installing collected packages: stasm
      Running setup.py install for stasm ... error
      error: subprocess-exited-with-error
    
      × Running setup.py install for stasm did not run successfully.
      │ exit code: 1
      ╰─> [32 lines of output]
          running install
          running build
          running build_py
          creating build
          creating build\lib.win-amd64-3.8
          creating build\lib.win-amd64-3.8\stasm
          copying stasm\__init__.py -> build\lib.win-amd64-3.8\stasm
          running egg_info
          writing stasm.egg-info\PKG-INFO
          writing dependency_links to stasm.egg-info\dependency_links.txt
          writing requirements to stasm.egg-info\requires.txt
          writing top-level names to stasm.egg-info\top_level.txt
          adding license file 'LICENSE.txt' (matched pattern 'LICEN[CS]E*')
          reading manifest file 'stasm.egg-info\SOURCES.txt'
          reading manifest template 'MANIFEST.in'
          writing manifest file 'stasm.egg-info\SOURCES.txt'
          creating build\lib.win-amd64-3.8\stasm\data
          copying stasm\data\README.txt -> build\lib.win-amd64-3.8\stasm\data
          copying stasm\data\haarcascade_frontalface_alt2.xml -> build\lib.win-amd64-3.8\stasm\data
          copying stasm\data\haarcascade_mcs_lefteye.xml -> build\lib.win-amd64-3.8\stasm\data
          copying stasm\data\haarcascade_mcs_righteye.xml -> build\lib.win-amd64-3.8\stasm\data
          copying stasm\data\testface.jpg -> build\lib.win-amd64-3.8\stasm\data
          running build_ext
          building '_stasm' 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
          creating build\temp.win-amd64-3.8\Release\src\MOD_1
          C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/local/include -I/usr/local/Cellar/opencv/3.4.1_5/include -I/usr/local/include/opencv4 -Ic:\users\kush\appdata\local\programs\python\python38\include -Ic:\users\kush\appdata\local\programs\python\python38\include -Ic:\users\kush\appdata\local\programs\python\python38\lib\site-packages\numpy\core\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tpsrc\asm.cpp /Fobuild\temp.win-amd64-3.8\Release\src\asm.obj /EHsc
          asm.cpp
          C:\Users\Kush\AppData\Local\Temp\pip-install-c76c4e85\stasm_c91c67ca4d8e48cd85bf6b73d98e1f85\src\stasm.h(33): fatal error C1083: Cannot open include file: 'opencv2/opencv.hpp': No such file or directory
          error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
          [end of output]
    
      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: legacy-install-failure
    
    × Encountered error while trying to install package.
    ╰─> stasm
    
    note: This is an issue with the package mentioned above, not pip.
    hint: See above for output from the failure.
    

    我已经安装了最新版本的MSVC。 我还尝试使用此链接安装opencv3 https://learnopencv.com/install-opencv3-on-windows/

    我应该如何解决此问题?如果您能帮我解决这个问题,我们将不胜感激。

    0 回复  |  直到 2 年前