반응형

아나콘다 환경에서 (Windows 윈도우 환경) dlib 설치를 진행하다 보면 아래와 같은 에러 문구가 확인될때가 있다.

 

pip3 install dlib

ERROR: Command errored out with exit status 1:
   command: 'X:\ML_GPU\Anaconda_py38_gpu_tensorflow\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\owner\\AppData\\Local\\Temp\\pip-install-gqmz0ix1\\dlib_fcf0ec19ca0a4c52ba416ef2bb98d80b\\setup.py'"'"'; __file__='"'"'C:\\Users\\owner\\AppData\\Local\\Temp\\pip-install-gqmz0ix1\\dlib_fcf0ec19ca0a4c52ba416ef2bb98d80b\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\owner\AppData\Local\Temp\pip-wheel-g9mx7ag6'
       cwd: C:\Users\owner\AppData\Local\Temp\pip-install-gqmz0ix1\dlib_fcf0ec19ca0a4c52ba416ef2bb98d80b\
  Complete output (58 lines):
  running bdist_wheel
  running build
  running build_py
  package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
  running build_ext
  Building extension for Python 3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)]
  Invoking CMake setup: 'cmake C:\Users\owner\AppData\Local\Temp\pip-install-gqmz0ix1\dlib_fcf0ec19ca0a4c52ba416ef2bb98d80b\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\owner\AppData\Local\Temp\pip-install-gqmz0ix1\dlib_fcf0ec19ca0a4c52ba416ef2bb98d80b\build\lib.win-amd64-3.8 -DPYTHON_EXECUTABLE=X:\ML_GPU\Anaconda_py38_gpu_tensorflow\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\owner\AppData\Local\Temp\pip-install-gqmz0ix1\dlib_fcf0ec19ca0a4c52ba416ef2bb98d80b\build\lib.win-amd64-3.8 -A x64'
  -- Building for: NMake Makefiles
  CMake Error at CMakeLists.txt:5 (message):



    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


    You must use Visual Studio to build a python extension on windows.  If you
    are getting this error it means you have not installed Visual C++.  Note
    that there are many flavors of Visual Studio, like Visual Studio for C#
    development.  You need to install Visual Studio for C++.


    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

위와 같이 나올경우, pip3 install -force 옵션으로 설치를 진행하면 패키지 불안정성이 야기될 수 있으니, 아래와 같이 진행을 하도록 하자.

 

Visual studio Community installer를 설치한 후,

 

위의 사진과 같이 c++를 사용한 데스크톱 개발을 선택하고 설치를 해주면 된다.

 

설치후, CMD창에서 다시 설치 진행시 아래와 같이 정상 설치된 것을 확인할 수 있다.

 

(X:\ML_GPU\Anaconda_py38_gpu_tensorflow) X:\ML_GPU\dlib-19.22.1>pip install dlib
Collecting dlib
  Using cached dlib-19.22.1.tar.gz (7.4 MB)
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... done
  Created wheel for dlib: filename=dlib-19.22.1-cp38-cp38-win_amd64.whl size=2945492 sha256=8bad302f69037a3a8899757339e2696bd2a2766d269c340f452574e017cfc3d3
  Stored in directory: c:\users\owner\appdata\local\pip\cache\wheels\c3\7d\3d\896cb44b682ef7c2c080d7d5d312ce8ba253aa4b03f858d398
Successfully built dlib
Installing collected packages: dlib
Successfully installed dlib-19.22.1
반응형

'IT 인터넷 > 머신러닝' 카테고리의 다른 글

파생 상품(옵션) - KFold  (0) 2022.05.17
주가예측 - KFOLD(교차검증-)  (0) 2022.05.16
주가 예측 - ARIMA(시계열 모델 기반)  (0) 2022.05.16

+ Recent posts