pupil-labs / pyuvc

python binding to libuvc
Other
117 stars 51 forks source link

mac can't install pyuvc #56

Closed mmihailescu closed 5 years ago

mmihailescu commented 5 years ago

I'm trying to install the dependencies for mac and I've been following the instructions on the pupil docs, yet I can't install the pyuvc, here is the terminal output after the brew installs...

Marias-MacBook-Air:build mariamihailescu$ git clone https://github.com/pupil-labs/libuvc Cloning into 'libuvc'... remote: Enumerating objects: 1059, done. remote: Total 1059 (delta 0), reused 0 (delta 0), pack-reused 1059 Receiving objects: 100% (1059/1059), 523.21 KiB | 2.07 MiB/s, done. Resolving deltas: 100% (635/635), done. Marias-MacBook-Air:build mariamihailescu$ cd libuvc Marias-MacBook-Air:libuvc mariamihailescu$ mkdir build Marias-MacBook-Air:libuvc mariamihailescu$ cd build Marias-MacBook-Air:build mariamihailescu$ cmake .. -- The C compiler identification is AppleClang 9.0.0.9000039 -- The CXX compiler identification is AppleClang 9.0.0.9000039 -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- No build type selected, default to Release -- No target type selected, default to shared library -- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") -- Checking for module 'libusb-1.0' -- Found libusb-1.0, version 1.0.22 -- Configuring done CMake Warning (dev): Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

uvc

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done -- Build files have been written to: /Users/mariamihailescu/libuvc/build/libuvc/build/libuvc/build/libuvc/build Marias-MacBook-Air:build mariamihailescu$ make && make install Scanning dependencies of target uvc [ 11%] Building C object CMakeFiles/uvc.dir/src/ctrl.c.o [ 22%] Building C object CMakeFiles/uvc.dir/src/ctrl-gen.c.o [ 33%] Building C object CMakeFiles/uvc.dir/src/device.c.o [ 44%] Building C object CMakeFiles/uvc.dir/src/diag.c.o [ 55%] Building C object CMakeFiles/uvc.dir/src/frame.c.o [ 66%] Building C object CMakeFiles/uvc.dir/src/init.c.o [ 77%] Building C object CMakeFiles/uvc.dir/src/stream.c.o /Users/mariamihailescu/libuvc/build/libuvc/build/libuvc/build/libuvc/src/stream.c:479:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ /Users/mariamihailescu/libuvc/build/libuvc/build/libuvc/build/libuvc/src/stream.c:530:9: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] const first_measure_int = 30 * 30;


2 warnings generated.
[ 88%] Building C object CMakeFiles/uvc.dir/src/misc.c.o
[100%] Linking C shared library libuvc.dylib
[100%] Built target uvc
[100%] Built target uvc
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libuvc.0.0.8.dylib
-- Up-to-date: /usr/local/lib/libuvc.0.dylib
-- Up-to-date: /usr/local/lib/libuvc.dylib
-- Installing: /usr/local/include/libuvc/libuvc.h
-- Installing: /usr/local/include/libuvc/libuvc_config.h
-- Installing: /usr/local/lib/cmake/libuvc/libuvcConfig.cmake
-- Installing: /usr/local/lib/cmake/libuvc/libuvcConfigVersion.cmake
-- Installing: /usr/local/lib/cmake/libuvc/libuvcTargets.cmake
-- Installing: /usr/local/lib/cmake/libuvc/libuvcTargets-release.cmake
-- Installing: /usr/local/lib/pkgconfig/libuvc.pc
Marias-MacBook-Air:build mariamihailescu$ pip3 install PyOpenGL
Requirement already satisfied: PyOpenGL in /usr/local/lib/python3.7/site-packages (3.1.0)
Marias-MacBook-Air:build mariamihailescu$ pip3 install pyzmq
Requirement already satisfied: pyzmq in /usr/local/lib/python3.7/site-packages (17.1.2)
Marias-MacBook-Air:build mariamihailescu$ pip3 install numexpr
Requirement already satisfied: numexpr in /usr/local/lib/python3.7/site-packages (2.6.8)
Requirement already satisfied: numpy>=1.7 in /usr/local/lib/python3.7/site-packages (from numexpr) (1.15.3)
Marias-MacBook-Air:build mariamihailescu$ pip3 install cython
Requirement already satisfied: cython in /usr/local/lib/python3.7/site-packages (0.29)
Marias-MacBook-Air:build mariamihailescu$ pip3 install psutil
Requirement already satisfied: psutil in /usr/local/lib/python3.7/site-packages (5.4.8)
Marias-MacBook-Air:build mariamihailescu$ pip3 install msgpack
Requirement already satisfied: msgpack in /usr/local/lib/python3.7/site-packages (0.5.6)
Marias-MacBook-Air:build mariamihailescu$ pip3 install pyaudio
Requirement already satisfied: pyaudio in /usr/local/lib/python3.7/site-packages (0.2.11)
Marias-MacBook-Air:build mariamihailescu$ pip3 install cysignals
Requirement already satisfied: cysignals in /usr/local/lib/python3.7/site-packages (1.7.2)
Requirement already satisfied: Cython>=0.28 in /usr/local/lib/python3.7/site-packages (from cysignals) (0.29)
Marias-MacBook-Air:build mariamihailescu$ pip3 install git+https://github.com/zeromq/pyre
Collecting git+https://github.com/zeromq/pyre
  Cloning https://github.com/zeromq/pyre to /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-r__2dg2h
Requirement already satisfied (use --upgrade to upgrade): pyre==0.3.2 from git+https://github.com/zeromq/pyre in /usr/local/lib/python3.7/site-packages
Requirement already satisfied: pyzmq in /usr/local/lib/python3.7/site-packages (from pyre==0.3.2) (17.1.2)
Requirement already satisfied: ipaddress in /usr/local/lib/python3.7/site-packages (from pyre==0.3.2) (1.0.22)
Building wheels for collected packages: pyre
  Running setup.py bdist_wheel for pyre ... done
  Stored in directory: /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-ephem-wheel-cache-kj6ixbw2/wheels/9b/0b/64/206d1748773c4708b3bcb11e0a429a6d0e1ef40c8bce622dc7
Successfully built pyre
Marias-MacBook-Air:build mariamihailescu$ pip3 install git+https://github.com/pupil-labs/PyAV
Collecting git+https://github.com/pupil-labs/PyAV
  Cloning https://github.com/pupil-labs/PyAV to /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-ekdigjo9
Requirement already satisfied (use --upgrade to upgrade): av==0.4.2.dev0 from git+https://github.com/pupil-labs/PyAV in /usr/local/lib/python3.7/site-packages
Building wheels for collected packages: av
  Running setup.py bdist_wheel for av ... done
  Stored in directory: /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-ephem-wheel-cache-vizp_oyc/wheels/c7/f1/4c/29c8d78ca3b6ac5474c6f61389edf31ff40d7f2b4e4cbfbb80
Successfully built av
Marias-MacBook-Air:build mariamihailescu$ pip3 install git+https://github.com/pupil-labs/pyuvc
Collecting git+https://github.com/pupil-labs/pyuvc
  Cloning https://github.com/pupil-labs/pyuvc to /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-e1hoy6t6
Building wheels for collected packages: uvc
  Running setup.py bdist_wheel for uvc ... error
  Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-e1hoy6t6/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/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-wheel-4t_iyesq --python-tag cp37:
  running bdist_wheel
  running build
  running build_ext
  building 'uvc' extension
  creating build
  creating build/temp.macosx-10.12-x86_64-3.7
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/lib/python3.7/site-packages/numpy/core/include -I/usr/local/opt/jpeg-turbo/include/ -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c uvc.c -o build/temp.macosx-10.12-x86_64-3.7/uvc.o
  In file included from uvc.c:644:
  In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
  In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
  In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:
  /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by "          "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
  #warning "Using deprecated NumPy API, disable it by " \
   ^
  uvc.c:16633:42: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
    __pyx_t_7 = ((__pyx_v_uvc_frame->width == __pyx_v_j_width) != 0);
                  ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~
  uvc.c:16639:43: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
    __pyx_t_7 = ((__pyx_v_uvc_frame->height == __pyx_v_j_height) != 0);
                  ~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~
  uvc.c:16812:26: warning: assigning to 'uvc_input_terminal_t *' (aka 'struct uvc_input_terminal *') from 'const uvc_input_terminal_t *' (aka 'const struct uvc_input_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    __pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
                           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  uvc.c:16821:27: warning: assigning to 'uvc_output_terminal_t *' (aka 'struct uvc_output_terminal *') from 'const uvc_output_terminal_t *' (aka 'const struct uvc_output_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    __pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
                            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  uvc.c:16830:27: warning: assigning to 'uvc_processing_unit_t *' (aka 'struct uvc_processing_unit *') from 'const uvc_processing_unit_t *' (aka 'const struct uvc_processing_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    __pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
                            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  uvc.c:16839:26: warning: assigning to 'uvc_extension_unit_t *' (aka 'struct uvc_extension_unit *') from 'const uvc_extension_unit_t *' (aka 'const struct uvc_extension_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    __pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
                           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  uvc.c:17411:23: warning: assigning to 'uvc_format_desc_t *' (aka 'struct uvc_format_desc *') from 'const uvc_format_desc_t *' (aka 'const struct uvc_format_desc *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    __pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  uvc.c:19757:13: warning: unused function '__pyx_f_3uvc_on_status_update' [-Wunused-function]
  static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
              ^
  9 warnings generated.
  creating build/lib.macosx-10.12-x86_64-3.7
  clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.7/uvc.o -L/usr/local/opt/jpeg-turbo/lib/ -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lturbojpeg -luvc.0.0.7 -o build/lib.macosx-10.12-x86_64-3.7/uvc.cpython-37m-darwin.so
  ld: library not found for -luvc.0.0.7
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  error: command 'clang' failed with exit status 1

  ----------------------------------------
  Failed building wheel for uvc
  Running setup.py clean for uvc
Failed to build uvc
Installing collected packages: uvc
  Running setup.py install for uvc ... error
    Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-e1hoy6t6/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/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-record-r10c7n10/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'uvc' extension
    creating build
    creating build/temp.macosx-10.12-x86_64-3.7
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/lib/python3.7/site-packages/numpy/core/include -I/usr/local/opt/jpeg-turbo/include/ -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c uvc.c -o build/temp.macosx-10.12-x86_64-3.7/uvc.o
    In file included from uvc.c:644:
    In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
    In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
    In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:
    /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by "          "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
    #warning "Using deprecated NumPy API, disable it by " \
     ^
    uvc.c:16633:42: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
      __pyx_t_7 = ((__pyx_v_uvc_frame->width == __pyx_v_j_width) != 0);
                    ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~
    uvc.c:16639:43: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
      __pyx_t_7 = ((__pyx_v_uvc_frame->height == __pyx_v_j_height) != 0);
                    ~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~
    uvc.c:16812:26: warning: assigning to 'uvc_input_terminal_t *' (aka 'struct uvc_input_terminal *') from 'const uvc_input_terminal_t *' (aka 'const struct uvc_input_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
                             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    uvc.c:16821:27: warning: assigning to 'uvc_output_terminal_t *' (aka 'struct uvc_output_terminal *') from 'const uvc_output_terminal_t *' (aka 'const struct uvc_output_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
                              ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    uvc.c:16830:27: warning: assigning to 'uvc_processing_unit_t *' (aka 'struct uvc_processing_unit *') from 'const uvc_processing_unit_t *' (aka 'const struct uvc_processing_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
                              ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    uvc.c:16839:26: warning: assigning to 'uvc_extension_unit_t *' (aka 'struct uvc_extension_unit *') from 'const uvc_extension_unit_t *' (aka 'const struct uvc_extension_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
                             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    uvc.c:17411:23: warning: assigning to 'uvc_format_desc_t *' (aka 'struct uvc_format_desc *') from 'const uvc_format_desc_t *' (aka 'const struct uvc_format_desc *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
                          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    uvc.c:19757:13: warning: unused function '__pyx_f_3uvc_on_status_update' [-Wunused-function]
    static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
                ^
    9 warnings generated.
    creating build/lib.macosx-10.12-x86_64-3.7
    clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.7/uvc.o -L/usr/local/opt/jpeg-turbo/lib/ -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lturbojpeg -luvc.0.0.7 -o build/lib.macosx-10.12-x86_64-3.7/uvc.cpython-37m-darwin.so
    ld: library not found for -luvc.0.0.7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'clang' failed with exit status 1

    ----------------------------------------
Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-e1hoy6t6/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/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-record-r10c7n10/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-e1hoy6t6/
burknator commented 5 years ago

I think* I found a solution. When installing uvc (as described here: https://docs.pupil-labs.com/#install-libuvc), checkout the tag v0.0.7 and then do the rest, like this:

git clone https://github.com/pupil-labs/libuvc
cd libuvc
git checkout v0.0.7
mkdir build
cd build
cmake ..
make && make install

Remove the build directory if you already have it.

* I "think" I found a solution, because my Pupil installation still doesn't work, but at least I don't get that linker error when trying to install pyuvc.

burknator commented 5 years ago

@papr Maybe this should be added to the developer docs?

papr commented 5 years ago

Fixed via https://github.com/pupil-labs/pyuvc/issues/53#issuecomment-441733216