0
votes

I m getting this error while using "pip install dlib" in pycharm in mac os. can anyone help me out

Collecting dlib Using cached dlib-19.19.0.tar.gz (3.2 MB) Installing collected packages: dlib Running setup.py install for dlib: started Running setup.py install for dlib: finished with status 'error'

ERROR: Command errored out with exit status 1:
 command: /Users/admin/Desktop/pythonwork/peoplecounter/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/setup.py'"'"'; __file__='"'"'/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/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/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pip-record-f48gmks5/install-record.txt --single-version-externally-managed --compile --install-headers /Users/admin/Desktop/pythonwork/peoplecounter/include/site/python3.7/dlib
     cwd: /private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/
Complete output (69 lines):
running install
running build
running build_py
package init file 'dlib/__init__.py' not found (or not a regular file)
warning: build_py: byte-compiling is disabled, skipping.

running build_ext
Building extension for Python 3.7.2 (default, Jan 13 2019, 12:50:01)
Invoking CMake setup: 'cmake /private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/build/lib.macosx-10.14-x86_64-3.7 -DPYTHON_EXECUTABLE=/Users/admin/Desktop/pythonwork/peoplecounter/bin/python -DCMAKE_BUILD_TYPE=Release'
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/local/Cellar/cmake/3.16.2/share/cmake/Modules/CMakeTestCCompiler.cmake:60 (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/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.14-x86_64-3.7/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make cmTC_35e30/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 (project)


-- Configuring incomplete, errors occurred!
See also "/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.14-x86_64-3.7/CMakeFiles/CMakeOutput.log".
See also "/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.14-x86_64-3.7/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/setup.py", line 261, in <module>
    'Topic :: Software Development',
  File "/Users/admin/Desktop/pythonwork/peoplecounter/lib/python3.7/site-packages/setuptools-39.1.0-py3.7.egg/setuptools/__init__.py", line 129, in setup
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/Users/admin/Desktop/pythonwork/peoplecounter/lib/python3.7/site-packages/setuptools-39.1.0-py3.7.egg/setuptools/command/install.py", line 61, in run
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py", line 545, in run
    self.run_command('build')
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/setup.py", line 135, in run
    self.build_extension(ext)
  File "/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/setup.py", line 172, in build_extension
    subprocess.check_call(cmake_setup, cwd=build_folder)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/build/lib.macosx-10.14-x86_64-3.7', '-DPYTHON_EXECUTABLE=/Users/admin/Desktop/pythonwork/peoplecounter/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
----------------------------------------

ERROR: Command errored out with exit status 1: /Users/admin/Desktop/pythonwork/peoplecounter/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/setup.py'"'"'; file='"'"'/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/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/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pip-record-f48gmks5/install-record.txt --single-version-externally-managed --compile --install-headers /Users/admin/Desktop/pythonwork/peoplecounter/include/site/python3.7/dlib Check the logs for full command output.

1

1 Answers

0
votes

I had the same issue in VSCode. After finding this issue I went to https://gist.github.com/gaquino/87bdf0e6e852e445c0489379d3e9732a

This reminded me that to upgrade to Catalina I had uninstalled XCode entirely and removed the Command Line tools to resolve some homebrew weirdness. I also migrated to zsh as that is Catalina's default. Not sure which of these requires a reinstall of XCode Command Line Tools, but I am sure one or several of them do.

Try installing the command line tools by opening a Terminal and typing:

$ xcode-select --install

And if this helps please credit me with closing this as it will De-StackOverflower me (be my first solved issue).

Thanks,

Daniel