Stackoverflow/Python

python, pip dlib install 에러 해결

The Neo 2020. 3. 12. 11:40

이미지 face landmark를 위해

pip install dlib를 하였는데 아래와 같이 설치가 안되고 있다

 

 

Collecting dlib
  Using cached dlib-19.19.0.tar.gz (3.2 MB)
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Anaconda3\envs\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-kj_i5y5x\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-kj_i5y5x\\d
lib\\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 'C:\Users\user\AppData\Local\Temp\pip-wheel-9_p7ovr1'
       cwd: C:\Users\user\AppData\Local\Temp\pip-install-kj_i5y5x\dlib\
  Complete output (53 lines):
  running bdist_wheel
  running build
  running build_py
  package init file 'dlib\__init__.py' not found (or not a regular file)
  running build_ext
  Traceback (most recent call last):
    File "C:\Users\user\AppData\Local\Temp\pip-install-kj_i5y5x\dlib\setup.py", line 120, in get_cmake_version
      out = subprocess.check_output(['cmake', '--version'])
    File "C:\Anaconda3\envs\python\lib\subprocess.py", line 411, in check_output
      **kwargs).stdout
    File "C:\Anaconda3\envs\python\lib\subprocess.py", line 488, in run
      with Popen(*popenargs, **kwargs) as process:
    File "C:\Anaconda3\envs\python\lib\subprocess.py", line 800, in __init__
      restore_signals, start_new_session)
    File "C:\Anaconda3\envs\python\lib\subprocess.py", line 1207, in _execute_child
      startupinfo)
  FileNotFoundError: [WinError 2] 지정된 파일을 찾을 수 없습니다
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\user\AppData\Local\Temp\pip-install-kj_i5y5x\dlib\setup.py", line 261, in <module>
      'Topic :: Software Development',
    File "C:\Anaconda3\envs\python\lib\site-packages\setuptools\__init__.py", line 144, in setup
      return distutils.core.setup(**attrs)
    File "C:\Anaconda3\envs\python\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "C:\Anaconda3\envs\python\lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "C:\Anaconda3\envs\python\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Anaconda3\envs\python\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "C:\Anaconda3\envs\python\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Anaconda3\envs\python\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Anaconda3\envs\python\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "C:\Anaconda3\envs\python\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Anaconda3\envs\python\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\user\AppData\Local\Temp\pip-install-kj_i5y5x\dlib\setup.py", line 129, in run
      cmake_version = self.get_cmake_version()
    File "C:\Users\user\AppData\Local\Temp\pip-install-kj_i5y5x\dlib\setup.py", line 125, in get_cmake_version
      "\n*******************************************************************\n")
  RuntimeError:
  *******************************************************************
   CMake must be installed to build the following extensions: dlib
  *******************************************************************

에러 문구를 보면 내용에 CMake를 설치하라는 내용이 나온다

(python) E:\Project\steel\python>pip install cmake
Collecting cmake
  Downloading cmake-3.16.3-py3-none-win_amd64.whl (32.4 MB)
     |████████████████████████████████| 32.4 MB 1.7 MB/s
Installing collected packages: cmake
Successfully installed cmake-3.16.3

cmake라는 것을 pip로 설치를 한 후

 

(python) E:\Project\steel\python>pip install dlib
Collecting dlib
  Using cached dlib-19.19.0.tar.gz (3.2 MB)
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... done
  Created wheel for dlib: filename=dlib-19.19.0-cp37-cp37m-win_amd64.whl size=3384482 sha256=c9df64d1ccf8581d00eacb1f5942e038e5939e29f0d07bbe94b01622018ee30a
  Stored in directory: c:\users\user\appdata\local\pip\cache\wheels\37\f0\61\23636e491ad55b8f9952f87233515947a8b16404b530c9f506
Successfully built dlib
Installing collected packages: dlib
Successfully installed dlib-19.19.0

다시 pip로 dlib를 install하니 성공적으로 설치가 된 것을 확인할 수 있다

반응형