Задать вопрос
Simpelax
@Simpelax
Нищий студент

Как установить пакет dlib в PyCharm если pip не работает?

Добрый день, я ломаю голову уже несколько дней над проблемой добавления пакета dlib в PyCharm. При попытке сделать это, как указано в руководстве джетбрейнсов выдает ошибку следующего вида(не пугайтесь пожалуйста)
тык
Collecting dlib
Using cached dlib-19.21.1.tar.gz (3.6 MB)
Using legacy 'setup.py install' for dlib, since package 'wheel' is not installed.
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: 'C:\Program Files\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Vladimir\\AppData\\Local\\Temp\\pip-install-wo1po3h2\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Vladimir\\AppData\\Local\\Temp\\pip-install-wo1po3h2\\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 'C:\Users\Vladimir\AppData\Local\Temp\pip-record-pigi9lcb\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Vladimir\AppData\Roaming\Python\Python38\Include\dlib'
cwd: C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\dlib\
Complete output (62 lines):
running install
running build
running build_py
package init file 'tools\python\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.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\dlib\build\lib.win-amd64-3.8 -DPYTHON_EXECUTABLE=C:\Program Files\Python38\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\dlib\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++.


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




-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\dlib\setup.py", line 223, in
setup(
File "C:\Program Files\Python38\lib\site-packages\setuptools\__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "C:\Program Files\Python38\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files\Python38\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\Python38\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Program Files\Python38\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Program Files\Python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\Python38\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Program Files\Python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\Vladimir\AppData\Local\Temp\pip-install-wo1po3h2\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Program Files\Python38\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Vladimir\\AppData\\Local\\Temp\\pip-install-wo1po3h2\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Vladimir\\AppData\\Local\\Temp\\pip-install-wo1po3h2\\dlib\\build\\lib.win-amd64-3.8', '-DPYTHON_EXECUTABLE=C:\\Program Files\\Python38\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Vladimir\\AppData\\Local\\Temp\\pip-install-wo1po3h2\\dlib\\build\\lib.win-amd64-3.8', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Vladimir\\AppData\\Local\\Temp\\pip-install-wo1po3h2\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Vladimir\\AppData\\Local\\Temp\\pip-install-wo1po3h2\\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 'C:\Users\Vladimir\AppData\Local\Temp\pip-record-pigi9lcb\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Vladimir\AppData\Roaming\Python\Python38\Include\dlib' Check the logs for full command output.
WARNING: You are using pip version 20.2.1; however, version 20.3.3 is available.
You should consider upgrading via the 'C:\Program Files\Python38\python.exe -m pip install --upgrade pip' command.


К слову, MS VC я поставил почти все версии, но ему просто плевать.
5fdb60a8949de623556718.png

Спасите меня пожалуйста, уже голова плывет...
  • Вопрос задан
  • 1355 просмотров
Подписаться 1 Средний Комментировать
Решения вопроса 1
deepblack
@deepblack
CMake установлен?

Здесь пошаговый пример
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
adugin
@adugin
Устанавливайте через анаконду c канала menpo:
conda install -c menpo dlib
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы