@Ivanzolo2001

Ошибка при установке dlib?

Началось все с того, что я решил поставить face_recognition (на Windows). При установке через pip мне вывелась огромная ошибка. Как я узнал дальше она появлялась именно при установке dlib. Перечитал много форумов. Сейчас у меня уже стоит Anaconda, cmake, в переменные среды cmake добавлен. Все равно dlib не скачивается. Пробовал через whl файл опять ошибка. Уже не знаю что делать. Вот сама ошибка
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
 command: 'C:\AllPython\CVLearn\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rvqw48ma\\dlib_4ae227b940e849b2b1d688b1c34f7100\\setup.py'"'"'; __file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rvqw48ma\\dlib_4ae227b940e849b2b1d688b1c34f7100\\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'"'"'))' install --record 'C:\Users\Admin\AppData\Local\Temp\pip-record-o6k8937e\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\AllPython\CVLearn\venv\include\site\python3.9\dlib'
     cwd: C:\Users\Admin\AppData\Local\Temp\pip-install-rvqw48ma\dlib_4ae227b940e849b2b1d688b1c34f7100\
Complete output (60 lines):
running install
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.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Admin\AppData\Local\Temp\pip-install-rvqw48ma\dlib_4ae227b940e849b2b1d688b1c34f7100\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Admin\AppData\Local\Temp\pip-install-rvqw48ma\dlib_4ae227b940e849b2b1d688b1c34f7100\build\lib.win-amd64-3.9 -DPYTHON_EXECUTABLE=C:\AllPython\CVLearn\venv\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Admin\AppData\Local\Temp\pip-install-rvqw48ma\dlib_4ae227b940e849b2b1d688b1c34f7100\build\lib.win-amd64-3.9 -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 "<string>", line 1, in <module>
  File "C:\Users\Admin\AppData\Local\Temp\pip-install-rvqw48ma\dlib_4ae227b940e849b2b1d688b1c34f7100\setup.py", line 222, in <module>
    setup(
  File "C:\AllPython\CVLearn\venv\lib\site-packages\setuptools\__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\AllPython\CVLearn\venv\lib\site-packages\setuptools\command\install.py", line 61, in run
    return orig.install.run(self)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\distutils\command\install.py", line 546, in run

    self.run_command('build')
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\Admin\AppData\Local\Temp\pip-install-rvqw48ma\dlib_4ae227b940e849b2b1d688b1c34f7100\setup.py", line 134, in run
    self.build_extension(ext)
  File "C:\Users\Admin\AppData\Local\Temp\pip-install-rvqw48ma\dlib_4ae227b940e849b2b1d688b1c34f7100\setup.py", line 171, in build_extension
    subprocess.check_call(cmake_setup, cwd=build_folder)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rvqw48ma\\dlib_4ae227b940e849b2b1d688b1c34f7100\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rvqw48ma\\dlib_4ae227b940e849b2b1d688b1c34f7100\\build\\lib.win-amd64-3.9', '-DPYTHON_EXECUTABLE=C:\\AllPython\\CVLearn\\venv\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rvqw48ma\\dlib_4ae227b940e849b2b1d688b1c34f7100\\build\\lib.win-amd64-3.9', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
   ERROR: Command errored out with exit status 1: 'C:\AllPython\CVLearn\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rvqw48ma\\dlib_4ae227b940e849b2b1d688b1c34f7100\\setup.py'"'"'; __file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rvqw48ma\\dlib_4ae227b940e849b2b1d688b1c34f7100\\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'"'"'))' install --record 'C:\Users\Admin\AppData\Local\Temp\pip-record-o6k8937e\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\AllPython\CVLearn\venv\include\site\python3.9\dlib' Check the logs for full command output.*


И вроде вот оно, тут прямым текстом написано, у вас нет Visual c++, но дело в том, что я пробовал уже около 10 раз его скачивать, разные версии и тд. Ни одна не влияет на установку НИКАК. Ошибка как и была так и осталась. Что делать??
  • Вопрос задан
  • 225 просмотров
Пригласить эксперта
Ваш ответ на вопрос

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

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