I am trying to install PyTorch but every time it throws the same error ( ModuleNotFoundError: No module named ‘tools.nnwrap’).
This is what is typed: pip install torch
This is what I get every time:
Collecting torch
Using cached https://files.pythonhosted.org/packages/f8/02/880b468bd382dc79896eaecbeb8ce95e9c4b99a24902874a2cef0b562cea/torch-0.1.2.post2.tar.gz
Requirement already satisfied: pyyaml in c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages (from torch) (5.1.2)
Installing collected packages: torch
Running setup.py install for torch … error
ERROR: Command errored out with exit status 1:
command: ‘c:\users\user\appdata\local\programs\python\python37-32\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\setup.py’"’"’; file=’"’"‘C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\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\User\AppData\Local\Temp\pip-record-b_c49sh\install-record.txt’ --single-version-externally-managed --compile
cwd: C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch
Complete output (23 lines):
running install
running build_deps
Traceback (most recent call last):
File “<string>”, line 1, in <module>
File “C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\setup.py”, line 265, in
description=“Tensors and Dynamic neural networks in Python with strong GPU acceleration”,
File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\setuptools_init.py", line 145, in setup
return distutils.core.setup(**attrs)
File “C:\Users\User\AppData\Local\Programs\Python\Python37-32\Lib\distutils\core.py”, line 148, in setup
dist.run_commands()
File “C:\Users\User\AppData\Local\Programs\Python\Python37-32\Lib\distutils\dist.py”, line 966, in run_commands
self.run_command(cmd)
File “C:\Users\User\AppData\Local\Programs\Python\Python37-32\Lib\distutils\dist.py”, line 985, in run_command
cmd_obj.run()
File “C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\setup.py”, line 99, in run
self.run_command(‘build_deps’)
File “C:\Users\User\AppData\Local\Programs\Python\Python37-32\Lib\distutils\cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “C:\Users\User\AppData\Local\Programs\Python\Python37-32\Lib\distutils\dist.py”, line 985, in run_command
cmd_obj.run()
File “C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\setup.py”, line 51, in run
from tools.nnwrap import generate_wrappers as generate_nn_wrappers
ModuleNotFoundError: No module named ‘tools.nnwrap’
----------------------------------------
ERROR: Command errored out with exit status 1: ‘c:\users\user\appdata\local\programs\python\python37-32\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\setup.py’"’"’; file=’"’"‘C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\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\User\AppData\Local\Temp\pip-record-_b_c49sh\install-record.txt’ --single-version-externally-managed --compile Check the logs for full command output.
Do anyone knows how to fix this error!!
# for OS: Windows, package: pip, Language: python3.6 (below command is valid for only mentioned python 3.6)
pip3 install https://download.pytorch.org/whl/cu90/torch-1.1.0-cp36-cp36m-win_amd64.whl
pip3 install https://download.pytorch.org/whl/cu90/torchvision-0.3.0-cp36-cp36m-win_amd64.whl
For another version/type of the software (OS, package, Language) installed, the command must be generated from the below-mentioned link: https://pytorch.org/get-started/locally/
It is recommended to directly get the desired URL that matches system configuration from the Pytorch website-https://pytorch.org/get-started/locally/
Select the options that meet your system config and using anaconda pip install the url
Try to paste the command
pip install torch==1.7.1+cpu torchvision==0.8.2+cpu torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
in the Anaconda Prompt. Worked for me.
Related
I am trying to install the 'mysql' package ( Version 0.0.2) , using pip install -r requirements.txt
But I am facing the following error:
Collecting mysql==0.0.2
Using cached mysql-0.0.2.tar.gz (1.9 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/pwiwdipw/virtualenv/ITC/3.6/bin/python3.6_bin -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sbgj4igk/mysql_4feada7a9dca4cc6b8bf0981676447ec/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sbgj4igk/mysql_4feada7a9dca4cc6b8bf0981676447ec/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'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-yaqwy2z8
cwd: /tmp/pip-install-sbgj4igk/mysql_4feada7a9dca4cc6b8bf0981676447ec/
Complete output (28 lines):
WARNING: `mysql` is a virtual package. Please use `%s` as a dependency directly.
running egg_info
creating /tmp/pip-pip-egg-info-yaqwy2z8/mysql.egg-info
writing /tmp/pip-pip-egg-info-yaqwy2z8/mysql.egg-info/PKG-INFO
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-sbgj4igk/mysql_4feada7a9dca4cc6b8bf0981676447ec/setup.py", line 42, in <module>
url="https://github.com/valhallasw/virtual-mysql-pypi-package",
File "/home/pwiwdipw/virtualenv/ITC/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/opt/alt/python36/lib64/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/alt/python36/lib64/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/opt/alt/python36/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/pwiwdipw/virtualenv/ITC/3.6/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 292, in run
writer(self, ep.name, os.path.join(self.egg_info, ep.name))
File "/home/pwiwdipw/virtualenv/ITC/3.6/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 656, in write_pkg_info
metadata.write_pkg_info(cmd.egg_info)
File "/opt/alt/python36/lib64/python3.6/distutils/dist.py", line 1106, in write_pkg_info
self.write_pkg_file(pkg_info)
File "/home/pwiwdipw/virtualenv/ITC/3.6/lib/python3.6/site-packages/setuptools/dist.py", line 188, in write_pkg_file
license = rfc822_escape(self.get_license())
File "/opt/alt/python36/lib64/python3.6/distutils/util.py", line 474, in rfc822_escape
lines = header.split('\n')
AttributeError: 'list' object has no attribute 'split'
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/bf/5f/b574ac9f70811df0540e403309f349a8b9fa1a25d3653824c32e52cc1f28/mysql-0.0.2.tar.gz#sha256=55e66b5e7b3823b1da5fb2a063e95a628fb850b2a0b76bdcd884faac5d2daa7d(from https://pypi.org/simple/mysql/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mysql==0.0.2 (from versions: 0.0.1, 0.0.2, 0.0.3)
ERROR: No matching distribution found for mysql==0.0.2
Steps taken to try to solve the issue:
1.I have tried changing the versions , yet the package is still not installing.
2.Manually trying to install it , using pip install mysql==0.0.2, instead of installing from requirements.txt
How do I solve this?
Thank you
Please follow that package's instructions:
https://pypi.org/project/mysql
mysql 0.0.3
... or mysqlclient (Python 3) ...
Instead of depending on this package, please depend on the relevant package directly.
This means installing https://anaconda.org/conda-forge/mysqlclient ,
for which conda will install
both the pure python code and the binary dependencies.
Conda won't require you to have a working gcc compiler installed.
Using python3.8.1, installing newest version, on Windows 10:
pip install PyNaCl gives me this error (last 10 lines):
File "C:\Program Files (x86)\Python3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files (x86)\Python3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 161, in run
raise Exception("ERROR: The 'make' utility is missing from PATH")
Exception: ERROR: The 'make' utility is missing from PATH
----------------------------------------
Failed building wheel for PyNaCl
Running setup.py clean for PyNaCl
Failed to build PyNaCl
Could not build wheels for PyNaCl which use PEP 517 and cannot be installed directly
It seems to be related to wheels, so i tried to install it with no-binary, which also failed:
File "C:\Program Files (x86)\Python3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Administrator\AppData\Local\Temp\pip-install-q0db5s_n\PyNaCl\setup.py", line 161, in run
raise Exception("ERROR: The 'make' utility is missing from PATH")
Exception: ERROR: The 'make' utility is missing from PATH
----------------------------------------
Command "C:\Users\Administrator\Documents\DiscordBot\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-q0db5s_n\\PyNaCl\\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\Administrator\AppData\Local\Temp\pip-record-s27dvlrv\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Administrator\Documents\DiscordBot\venv\include\site\python3.8\PyNaCl" failed with error code 1 in C:\Users\Administrator\AppData\Local\Temp\pip-install-q0db5s_n\PyNaCl\
EDIT: This only seems to be an issue in my venv (made by Pycharm) - i have no clue what the issue is, both setuptools and wheel are installed.
I ultimately solved it by using python -m pip install --no-use-pep517 pynacl
Upgrading pip within the venv worked for me:
.\env\Scripts\activate
pip install -U pip
pip install -r requirements.txt
deactivate
I wanted to work on a project involving face recognition, but when I tried to install face_recognition library, it gave me this output-
Collecting face_recognition
Using cached https://files.pythonhosted.org/packages/1e/95/f6c9330f54ab07bfa032bf3715c12455a381083125d8880c43cbe76bb3d0/face_recognition-1.3.0-py2.py3-none-any.whl
Collecting dlib>=19.7 (from face_recognition)
Using cached https://files.pythonhosted.org/packages/63/92/05c3b98636661cb80d190a5a777dd94effcc14c0f6893222e5ca81e74fbc/dlib-19.19.0.tar.gz
Collecting face-recognition-models>=0.3.0 (from face_recognition)
Using cached https://files.pythonhosted.org/packages/cf/3b/4fd8c534f6c0d1b80ce0973d01331525538045084c73c153ee6df20224cf/face_recognition_models-0.3.0.tar.gz
Collecting Click>=6.0 (from face_recognition)
Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl
Collecting numpy (from face_recognition)
Using cached https://files.pythonhosted.org/packages/14/ef/9f2eeb4ff0c733ad9149f17266e388c308e171fdb8c2415dbb472e2bbc0f/numpy-1.16.6-cp27-cp27m-win_amd64.whl
Collecting Pillow (from face_recognition)
Using cached https://files.pythonhosted.org/packages/5e/b6/8960697526a79bd1cb4520293078be3a10d725f23f20abbee298ebdeaabd/Pillow-6.2.2-cp27-cp27m-win_amd64.whl
Installing collected packages: dlib, face-recognition-models, Click, numpy, Pillow, face-recognition
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\adity\\appdata\\local\\temp\\pip-install-rosjjw\\dlib\\setup.py'"'"'; __file__='"'"'c:\\users\\adity\\appdata\\local\\temp\\pip-install-rosjjw\\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\adity\appdata\local\temp\pip-record-jqvmxp\install-record.txt' --single-version-externally-managed --compile
cwd: c:\users\adity\appdata\local\temp\pip-install-rosjjw\dlib\
Complete output (40 lines):
running install
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 "<string>", line 1, in <module>
File "c:\users\adity\appdata\local\temp\pip-install-rosjjw\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "c:\python27\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\python27\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "c:\python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "c:\python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\python27\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\python27\lib\distutils\command\install.py", line 563, in run
self.run_command('build')
File "c:\python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "c:\python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\python27\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "c:\python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "c:\python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\users\adity\appdata\local\temp\pip-install-rosjjw\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "c:\users\adity\appdata\local\temp\pip-install-rosjjw\dlib\setup.py", line 125, in get_cmake_version
"\n*******************************************************************\n")
RuntimeError:
*******************************************************************
CMake must be installed to build the following extensions: dlib
*******************************************************************
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\adity\\appdata\\local\\temp\\pip-install-rosjjw\\dlib\\setup.py'"'"'; __file__='"'"'c:\\users\\adity\\appdata\\local\\temp\\pip-install-rosjjw\\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\adity\appdata\local\temp\pip-record-jqvmxp\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
How can I fix this? In Windows 10?
*I guess I have to install Cmake and Dlib, but it's giving the same error
(python 3.6.8)
RuntimeError:
*******************************************************************
CMake must be installed to build the following extensions: dlib
*******************************************************************
I ran into the same problem recently, I resolved it downloading CMAKE.
Here is the link to download it for each OS
I can't install python net everything in previous solutions I have followed through and it still doesn't work.
I have tried everything. Do I need to uninstall python and do it again?
pip install pyhtonnet
ERROR: Could not find a version that satisfies the requirement pyhtonnet (from versions: none)
ERROR: No matching distribution found for pyhtonnet
C:\Users\vishv>pip install pythonnet
Collecting pythonnet
Using cached pythonnet-2.4.0.tar.gz (1.8 MB)
Building wheels for collected packages: pythonnet
Building wheel for pythonnet (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\vishv\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\setup.py'"'"'; file='"'"'C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\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\vishv\AppData\Local\Temp\pip-wheel-qw1gpb32'
cwd: C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet
Complete output (69 lines):
running bdist_wheel
running build
running build_ext
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 4.1.0.
Updating NuGet.exe to 5.4.0.
Update successful.
Cannot find the specified version of msbuild: '14'
MSBuild auto-detection: using msbuild version '4.0' from 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319'.
Restoring NuGet package NUnit.3.7.1.
Restoring NuGet package NUnit.ConsoleRunner.3.7.0.
Restoring NuGet package UnmanagedExports.1.2.7.
Adding package 'NUnit.ConsoleRunner.3.7.0' to folder 'C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\packages'
Adding package 'NUnit.3.7.1' to folder 'C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\packages'
Adding package 'UnmanagedExports.1.2.7' to folder 'C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\packages'
Added package 'UnmanagedExports.1.2.7' to folder 'C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\packages'
Added package 'NUnit.ConsoleRunner.3.7.0' to folder 'C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\packages'
Added package 'NUnit.3.7.1' to folder 'C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\packages'
NuGet Config files used:
C:\Users\vishv\AppData\Roaming\NuGet\NuGet.Config
Feeds used:
C:\Users\vishv.nuget\packages
https://api.nuget.org/v3/index.json
Installed:
3 package(s) to packages.config projects
Traceback (most recent call last):
File "tools\geninterop\geninterop.py", line 24, in
from pycparser import c_ast, c_parser
ModuleNotFoundError: No module named 'pycparser'
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\setup.py", line 623, in
setup(
File "c:\users\vishv\appdata\local\programs\python\python38\lib\site-packages\setuptools_init_.py", line 144, in setup
return distutils.core.setup(**attrs)
File "c:\users\vishv\appdata\local\programs\python\python38\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\vishv\appdata\local\programs\python\python38\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\vishv\appdata\local\programs\python\python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\setup.py", line 610, in run
return bdist_wheel.bdist_wheel.run(self)
File "c:\users\vishv\appdata\local\programs\python\python38\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
self.run_command('build')
File "c:\users\vishv\appdata\local\programs\python\python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\vishv\appdata\local\programs\python\python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\vishv\appdata\local\programs\python\python38\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\vishv\appdata\local\programs\python\python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\vishv\appdata\local\programs\python\python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\vishv\appdata\local\programs\python\python38\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "c:\users\vishv\appdata\local\programs\python\python38\lib\distutils\command\build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "c:\users\vishv\appdata\local\programs\python\python38\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\setup.py", line 298, in build_extension
subprocess.check_call([sys.executable, geninterop, interop_file])
File "c:\users\vishv\appdata\local\programs\python\python38\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['c:\users\vishv\appdata\local\programs\python\python38\python.exe', 'tools\geninterop\geninterop.py', 'src\runtime\interop38.cs']' returned non-zero exit status 1.
ERROR: Failed building wheel for pythonnet
Running setup.py clean for pythonnet
Failed to build pythonnet
Installing collected packages: pythonnet
Running setup.py install for pythonnet ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\vishv\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\setup.py'"'"'; file='"'"'C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\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\vishv\AppData\Local\Temp\pip-record-h9hrt2n6\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\vishv\appdata\local\programs\python\python38\Include\pythonnet'
cwd: C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --single-version-externally-managed not recognized
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\vishv\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\setup.py'"'"'; file='"'"'C:\Users\vishv\AppData\Local\Temp\pip-install-pwmwkrlc\pythonnet\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\vishv\AppData\Local\Temp\pip-record-h9hrt2n6\install-record.txt' --single-version-externally-managed --compile --install-headers
Have you tried installing python 3.7 instead of 3.8? I just ran into a similar error with 3.8 but no problems with 3.7 (and upgraded pip and setuptools). Seems like 3.8. will only work with pythonnet version >= 2.5
I have already installed CMake by pip install cmake and tried to install face_recognition but it still gives me a RuntimeError. I'm using 'Python 3.7.3, x32'
I also tried to install the dlib by pip install dlib since it is one of the reasons why I can't install face_recognition.
C:\Users\user>python -m pip install cmake
Requirement already satisfied: cmake in c:\users\user\appdata\roaming\python\python37\site-packages (3.14.4)
C:\Users\user>python -m pip install dlib
Collecting dlib
Using cached https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Complete output from command 'C:\Python\Python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-24vk6act\\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\user\AppData\Local\Temp\pip-record-yf2kdjpx\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
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-24vk6act\dlib\setup.py", line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "C:\Python\Python37\lib\subprocess.py", line 395, in check_output
**kwargs).stdout
File "C:\Python\Python37\lib\subprocess.py", line 472, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Python\Python37\lib\subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "C:\Python\Python37\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
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-24vk6act\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Python\Python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python\Python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Python\Python37\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Python\Python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\user\AppData\Local\Temp\pip-install-24vk6act\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\user\AppData\Local\Temp\pip-install-24vk6act\dlib\setup.py", line 125, in get_cmake_version
"\n*******************************************************************\n")
RuntimeError:
*******************************************************************
CMake must be installed to build the following extensions: dlib
*******************************************************************
----------------------------------------
ERROR: Command "'C:\Python\Python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-24vk6act\\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\user\AppData\Local\Temp\pip-record-yf2kdjpx\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip-install-24vk6act\dlib\
Download and install dlib wheel from here
Then pip install face_recognition
pip install cmake
In visual studio, Individual Components
tab,Visual C++ tools for Cmake checkbox under Compilers,build tools
and runtimes Section
On Visual Studio Command prompt run, pip install face_recognition
Source
What works for is ...
After getting lots of Red Errors, I run following
conda install -c conda-forge dlib
pip install cmake
pip install face_recognition
Even the error says me to reinstall VS Code for c++. but above sequential installation works.
Python version was 3.8
Try install dlib using conda
conda install -c conda-forge dlib
For me, non of the solutions didn't work. Then, I downloaded all libraries in face_recognition package manually (like "pip install dlib==19.7", "pip install Click". At last, I installed face recognition with this command "pip install --no-deps face_recognition"