Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pip install errors #4

Open
thorwhalen opened this issue Oct 12, 2020 · 2 comments
Open

Pip install errors #4

thorwhalen opened this issue Oct 12, 2020 · 2 comments

Comments

@thorwhalen
Copy link

In python 3.8.2.
On a mac with iOS 10.14.6

$ pip install stasm
Collecting stasm
  Using cached stasm-2.0.2.tar.gz (688 kB)
Requirement already satisfied: numpy>=1.10 in ./.virtualenvs/382/lib/python3.8/site-packages (from stasm) (1.18.2)
Building wheels for collected packages: stasm
  Building wheel for stasm (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/twhalen/.virtualenvs/382/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/fn/1nt17_n93j91mxdv4gg0fnbw0000gp/T/pip-install-c4llqd_r/stasm/setup.py'"'"'; __file__='"'"'/private/var/folders/fn/1nt17_n93j91mxdv4gg0fnbw0000gp/T/pip-install-c4llqd_r/stasm/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/fn/1nt17_n93j91mxdv4gg0fnbw0000gp/T/pip-wheel-bavq3qu6
       cwd: /private/var/folders/fn/1nt17_n93j91mxdv4gg0fnbw0000gp/T/pip-install-c4llqd_r/stasm/
  Complete output (33 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14-x86_64-3.8
  creating build/lib.macosx-10.14-x86_64-3.8/stasm
  copying stasm/__init__.py -> build/lib.macosx-10.14-x86_64-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
  reading manifest file 'stasm.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'stasm.egg-info/SOURCES.txt'
  creating build/lib.macosx-10.14-x86_64-3.8/stasm/data
  copying stasm/data/README.txt -> build/lib.macosx-10.14-x86_64-3.8/stasm/data
  copying stasm/data/haarcascade_frontalface_alt2.xml -> build/lib.macosx-10.14-x86_64-3.8/stasm/data
  copying stasm/data/haarcascade_mcs_lefteye.xml -> build/lib.macosx-10.14-x86_64-3.8/stasm/data
  copying stasm/data/haarcascade_mcs_righteye.xml -> build/lib.macosx-10.14-x86_64-3.8/stasm/data
  copying stasm/data/testface.jpg -> build/lib.macosx-10.14-x86_64-3.8/stasm/data
  running build_ext
  building '_stasm' extension
  creating build/temp.macosx-10.14-x86_64-3.8
  creating build/temp.macosx-10.14-x86_64-3.8/src
  creating build/temp.macosx-10.14-x86_64-3.8/src/MOD_1
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/usr/local/include -I/usr/local/Cellar/opencv/3.4.1_5/include -I/usr/local/include/opencv4 -I/Users/twhalen/.virtualenvs/382/include -I/Users/twhalen/.pyenv/versions/3.8.2/include/python3.8 -I/Users/twhalen/.virtualenvs/382/lib/python3.8/site-packages/numpy/core/include -c src/startshape.cpp -o build/temp.macosx-10.14-x86_64-3.8/src/startshape.o -std=c++11
  In file included from src/startshape.cpp:30:
  src/stasm.h:33:10: fatal error: 'opencv2/opencv.hpp' file not found
  #include "opencv2/opencv.hpp"
           ^~~~~~~~~~~~~~~~~~~~
  1 error generated.
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for stasm
  Running setup.py clean for stasm
Failed to build stasm
Installing collected packages: stasm
    Running setup.py install for stasm ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/twhalen/.virtualenvs/382/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/fn/1nt17_n93j91mxdv4gg0fnbw0000gp/T/pip-install-c4llqd_r/stasm/setup.py'"'"'; __file__='"'"'/private/var/folders/fn/1nt17_n93j91mxdv4gg0fnbw0000gp/T/pip-install-c4llqd_r/stasm/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/fn/1nt17_n93j91mxdv4gg0fnbw0000gp/T/pip-record-kbw35e8t/install-record.txt --single-version-externally-managed --compile --install-headers /Users/twhalen/.virtualenvs/382/include/site/python3.8/stasm
         cwd: /private/var/folders/fn/1nt17_n93j91mxdv4gg0fnbw0000gp/T/pip-install-c4llqd_r/stasm/
    Complete output (33 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-x86_64-3.8
    creating build/lib.macosx-10.14-x86_64-3.8/stasm
    copying stasm/__init__.py -> build/lib.macosx-10.14-x86_64-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
    reading manifest file 'stasm.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'stasm.egg-info/SOURCES.txt'
    creating build/lib.macosx-10.14-x86_64-3.8/stasm/data
    copying stasm/data/README.txt -> build/lib.macosx-10.14-x86_64-3.8/stasm/data
    copying stasm/data/haarcascade_frontalface_alt2.xml -> build/lib.macosx-10.14-x86_64-3.8/stasm/data
    copying stasm/data/haarcascade_mcs_lefteye.xml -> build/lib.macosx-10.14-x86_64-3.8/stasm/data
    copying stasm/data/haarcascade_mcs_righteye.xml -> build/lib.macosx-10.14-x86_64-3.8/stasm/data
    copying stasm/data/testface.jpg -> build/lib.macosx-10.14-x86_64-3.8/stasm/data
    running build_ext
    building '_stasm' extension
    creating build/temp.macosx-10.14-x86_64-3.8
    creating build/temp.macosx-10.14-x86_64-3.8/src
    creating build/temp.macosx-10.14-x86_64-3.8/src/MOD_1
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/usr/local/include -I/usr/local/Cellar/opencv/3.4.1_5/include -I/usr/local/include/opencv4 -I/Users/twhalen/.virtualenvs/382/include -I/Users/twhalen/.pyenv/versions/3.8.2/include/python3.8 -I/Users/twhalen/.virtualenvs/382/lib/python3.8/site-packages/numpy/core/include -c src/startshape.cpp -o build/temp.macosx-10.14-x86_64-3.8/src/startshape.o -std=c++11
    In file included from src/startshape.cpp:30:
    src/stasm.h:33:10: fatal error: 'opencv2/opencv.hpp' file not found
    #include "opencv2/opencv.hpp"
             ^~~~~~~~~~~~~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/twhalen/.virtualenvs/382/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/fn/1nt17_n93j91mxdv4gg0fnbw0000gp/T/pip-install-c4llqd_r/stasm/setup.py'"'"'; __file__='"'"'/private/var/folders/fn/1nt17_n93j91mxdv4gg0fnbw0000gp/T/pip-install-c4llqd_r/stasm/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/fn/1nt17_n93j91mxdv4gg0fnbw0000gp/T/pip-record-kbw35e8t/install-record.txt --single-version-externally-managed --compile --install-headers /Users/twhalen/.virtualenvs/382/include/site/python3.8/stasm Check the logs for full command output.
@solveretur
Copy link

+1

@jankaWIS
Copy link

The same goes for Windows and for pip install PyStasm. Found this comment by millpond here, possible solution?

stasm is looking for opencv header files in the MSVC Include dirs.

Typically you can grab the source for a package and copy the \Include dir to the MSVC Include path, and it should work. Though not here. Stasm eventually wants opencv_modules.hpp which is only generated after a proper compilation (not a typical install). Which does not look possible without a decent working knowledge of Visual Studio, or VSC.

Hint: Symlink MSVC Include and Lib dirs to an easy to get to location to allow easier access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants