Can't install PL 0.12.18

I’ve created a new MiniConda env but when i try to pip install perceptilabs, it eventually gives the error below during the install process. This seems to be something related to opencv-python. I’m running on MacOS 10.14.6:

Created wheel for retrying: filename=retrying-1.3.3-py3-none-any.whl size=11429 sha256=986e74b8aff1886a6e8d89dc6a35b406d98aab9e03be5940bde1ccbfe9359005
Stored in directory: /Users/dana/Library/Caches/pip/wheels/ac/cb/8a/b27bf6323e2f4c462dcbf77d70b7c5e7868a7fbe12871770cf
Building wheel for opencv-python (PEP 517) … error
ERROR: Command errored out with exit status 1:
command: /Users/dana/opt/miniconda3/envs/plaug10_official/bin/python /Users/dana/opt/miniconda3/envs/plaug10_official/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/3w/mjbw45_n36n6sr55lv2r67j00000gn/T/tmpjoztqekm
cwd: /private/var/folders/3w/mjbw45_n36n6sr55lv2r67j00000gn/T/pip-install-713ffw9t/opencv-python_37fc2cdf8bff4ced96f5cc762146456d
Complete output (102 lines):
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.

Not searching for unused variables given on the command line.

CMake Error: CMake was unable to find a build program corresponding to “Ninja”. CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
– Configuring incomplete, errors occurred!
See also “/private/var/folders/3w/mjbw45_n36n6sr55lv2r67j00000gn/T/pip-install-713ffw9t/opencv-python_37fc2cdf8bff4ced96f5cc762146456d/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log”.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.

Not searching for unused variables given on the command line.

– The C compiler identification is unknown
– Detecting C compiler ABI info
– Detecting C compiler ABI info - failed
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc - broken
CMake Error at /private/var/folders/3w/mjbw45_n36n6sr55lv2r67j00000gn/T/pip-build-env-mbkrjcfs/overlay/lib/python3.6/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.21/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler

  "/usr/bin/cc"

is not able to compile a simple test program.

It fails with the following output:

  Change Dir: /private/var/folders/3w/mjbw45_n36n6sr55lv2r67j00000gn/T/pip-install-713ffw9t/opencv-python_37fc2cdf8bff4ced96f5cc762146456d/_cmake_test_compile/build/CMakeFiles/CMakeTmp

  Run Build Command(s):/usr/bin/make -f Makefile cmTC_afd93/fast && xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun





CMake will not be able to correctly generate this project.

Call Stack (most recent call first):
CMakeLists.txt:3 (ENABLE_LANGUAGE)

– Configuring incomplete, errors occurred!
See also “/private/var/folders/3w/mjbw45_n36n6sr55lv2r67j00000gn/T/pip-install-713ffw9t/opencv-python_37fc2cdf8bff4ced96f5cc762146456d/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log”.
See also “/private/var/folders/3w/mjbw45_n36n6sr55lv2r67j00000gn/T/pip-install-713ffw9t/opencv-python_37fc2cdf8bff4ced96f5cc762146456d/_cmake_test_compile/build/CMakeFiles/CMakeError.log”.


– Trying “Ninja” generator












– Trying “Ninja” generator - failure


– Trying “Unix Makefiles” generator












– Trying “Unix Makefiles” generator - failure


scikit-build could not get a working generator for your system. Aborting build.

Building MacOSX wheels for Python 3.6 requires XCode.
Get it here:

https://developer.apple.com/xcode/


ERROR: Failed building wheel for opencv-python
Successfully built click-didyoumean idna-ssl retrying
Failed to build opencv-python
ERROR: Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly

I ran the following - i’m not sure if they were required - within my virtual env:
brew install ninja
pip install ninja

I then ran the following which seemed to be the main solution to the error:
xcode-select --install

followed by

pip install perceptilabs

This finally got past the error that was occuring for “Building wheel for opencv-python (PEP 517)”.

However, now this line: “Building wheel for opencv-python (PEP 517)” is taking forever to build.

Ok - I’ve tried this again with the latest (0.12.24) release and had the same issue when running pip install perceptilabs. However, this time I left it run and found that it took over 22 minutes for the Building wheel for opencv-python (PEP 517) part to finally finish. This means that the overall installation for PerceptiLabs was well over 25 minutes in total.

From what I’ve read online, this is a common complaint for opencv-python as it’s a big package with lots of stuff to build. Is there a way to circumvent this so we don’t have to build opencv-pthon?

Hi @danaf,
There is no current way to circumvent it as pip will install all the dependencies automatically and OpenCV is being used inside the tool for some visualizations.
I added a ticket here though for replacing it: https://perceptilabs.canny.io/feature-requests/p/remove-the-opencv-dependency