Pip doesn't work, says it cannot build wheels - python

I've looked online for a solution but haven't found one.
I have a new computer which is the first desktop I own and I need to install python and pip and all these things for a high school project, but when installing PyTorch and other packages I need I am met with this error:
C:\Users\Owlsoul>pip3 install torch
Defaulting to user installation because normal site-packages is not writeable
Collecting torch
Using cached torch-0.1.2.post2.tar.gz (128 kB)
Collecting pyyaml
Using cached PyYAML-5.3.1.tar.gz (269 kB)
Building wheels for collected packages: torch, pyyaml
Building wheel for torch (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\program files\inkscape\bin\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-hw6a8m3j\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-hw6a8m3j\\torch\\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\Owlsoul\AppData\Local\Temp\pip-wheel-kmaghkld'
cwd: C:\Users\Owlsoul\AppData\Local\Temp\pip-install-hw6a8m3j\torch\
Complete output (30 lines):
running bdist_wheel
running build
running build_deps
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Owlsoul\AppData\Local\Temp\pip-install-hw6a8m3j\torch\setup.py", line 225, in <module>
setup(name="torch", version="0.1.2.post2",
File "C:\Users\Owlsoul\.local\lib\python3.8\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\program files\inkscape\lib\python3.8\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\program files\inkscape\lib\python3.8\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\program files\inkscape\lib\python3.8\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Owlsoul\.local\lib\python3.8\site-packages\wheel\bdist_wheel.py", line 290, in run
self.run_command('build')
File "C:\program files\inkscape\lib\python3.8\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\program files\inkscape\lib\python3.8\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\program files\inkscape\lib\python3.8\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\program files\inkscape\lib\python3.8\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\program files\inkscape\lib\python3.8\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Owlsoul\AppData\Local\Temp\pip-install-hw6a8m3j\torch\setup.py", line 51, in run
from tools.nnwrap import generate_wrappers as generate_nn_wrappers
ModuleNotFoundError: No module named 'tools.nnwrap'
----------------------------------------
ERROR: Failed building wheel for torch
Running setup.py clean for torch
ERROR: Command errored out with exit status 1:
command: 'c:\program files\inkscape\bin\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-hw6a8m3j\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-hw6a8m3j\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
cwd: C:\Users\Owlsoul\AppData\Local\Temp\pip-install-hw6a8m3j\torch
Complete output (2 lines):
running clean
error: [Errno 2] No such file or directory: '.gitignore'
----------------------------------------
ERROR: Failed cleaning build dir for torch
Building wheel for pyyaml (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\program files\inkscape\bin\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-hw6a8m3j\\pyyaml\\setup.py'"'"'; __file__='"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-hw6a8m3j\\pyyaml\\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\Owlsoul\AppData\Local\Temp\pip-wheel-nztx1z7u'
cwd: C:\Users\Owlsoul\AppData\Local\Temp\pip-install-hw6a8m3j\pyyaml\
Complete output (59 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.mingw-3.8
creating build\lib.mingw-3.8\yaml
copying lib3\yaml\composer.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\constructor.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\cyaml.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\dumper.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\emitter.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\error.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\events.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\loader.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\nodes.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\parser.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\reader.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\representer.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\resolver.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\scanner.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\serializer.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\tokens.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\__init__.py -> build\lib.mingw-3.8\yaml
running build_ext
'gcc' is not recognized as an internal or external command,
operable program or batch file.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Owlsoul\AppData\Local\Temp\pip-install-hw6a8m3j\pyyaml\setup.py", line 291, in <module>
setup(
File "C:\program files\inkscape\lib\python3.8\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\program files\inkscape\lib\python3.8\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\program files\inkscape\lib\python3.8\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Owlsoul\.local\lib\python3.8\site-packages\wheel\bdist_wheel.py", line 290, in run
self.run_command('build')
File "C:\program files\inkscape\lib\python3.8\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\program files\inkscape\lib\python3.8\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\program files\inkscape\lib\python3.8\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\program files\inkscape\lib\python3.8\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\program files\inkscape\lib\python3.8\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Owlsoul\AppData\Local\Temp\pip-install-hw6a8m3j\pyyaml\setup.py", line 185, in run
_build_ext.run(self)
File "C:\program files\inkscape\lib\python3.8\distutils\command\build_ext.py", line 307, in run
self.compiler = new_compiler(compiler=self.compiler,
File "C:\program files\inkscape\lib\python3.8\distutils\ccompiler.py", line 1034, in new_compiler
return klass(None, dry_run, force)
File "C:\program files\inkscape\lib\python3.8\distutils\cygwinccompiler.py", line 310, in __init__
CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "C:\program files\inkscape\lib\python3.8\distutils\cygwinccompiler.py", line 127, in __init__
if self.ld_version >= "2.10.90":
TypeError: '>=' not supported between instances of 'NoneType' and 'str'
----------------------------------------
ERROR: Failed building wheel for pyyaml
Running setup.py clean for pyyaml
Failed to build torch pyyaml
Installing collected packages: pyyaml, torch
Running setup.py install for pyyaml ... error
ERROR: Command errored out with exit status 1:
command: 'c:\program files\inkscape\bin\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-hw6a8m3j\\pyyaml\\setup.py'"'"'; __file__='"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-hw6a8m3j\\pyyaml\\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\Owlsoul\AppData\Local\Temp\pip-record-v7hld7x2\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Owlsoul\.local\include\python3.8\pyyaml'
cwd: C:\Users\Owlsoul\AppData\Local\Temp\pip-install-hw6a8m3j\pyyaml\
Complete output (61 lines):
running install
running build
running build_py
creating build
creating build\lib.mingw-3.8
creating build\lib.mingw-3.8\yaml
copying lib3\yaml\composer.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\constructor.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\cyaml.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\dumper.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\emitter.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\error.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\events.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\loader.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\nodes.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\parser.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\reader.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\representer.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\resolver.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\scanner.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\serializer.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\tokens.py -> build\lib.mingw-3.8\yaml
copying lib3\yaml\__init__.py -> build\lib.mingw-3.8\yaml
running build_ext
'gcc' is not recognized as an internal or external command,
operable program or batch file.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Owlsoul\AppData\Local\Temp\pip-install-hw6a8m3j\pyyaml\setup.py", line 291, in <module>
setup(
File "C:\program files\inkscape\lib\python3.8\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\program files\inkscape\lib\python3.8\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\program files\inkscape\lib\python3.8\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Owlsoul\.local\lib\python3.8\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\program files\inkscape\lib\python3.8\distutils\command\install.py", line 546, in run
self.run_command('build')
File "C:\program files\inkscape\lib\python3.8\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\program files\inkscape\lib\python3.8\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\program files\inkscape\lib\python3.8\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\program files\inkscape\lib\python3.8\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\program files\inkscape\lib\python3.8\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Owlsoul\AppData\Local\Temp\pip-install-hw6a8m3j\pyyaml\setup.py", line 185, in run
_build_ext.run(self)
File "C:\program files\inkscape\lib\python3.8\distutils\command\build_ext.py", line 307, in run
self.compiler = new_compiler(compiler=self.compiler,
File "C:\program files\inkscape\lib\python3.8\distutils\ccompiler.py", line 1034, in new_compiler
return klass(None, dry_run, force)
File "C:\program files\inkscape\lib\python3.8\distutils\cygwinccompiler.py", line 310, in __init__
CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "C:\program files\inkscape\lib\python3.8\distutils\cygwinccompiler.py", line 127, in __init__
if self.ld_version >= "2.10.90":
TypeError: '>=' not supported between instances of 'NoneType' and 'str'
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files\inkscape\bin\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-hw6a8m3j\\pyyaml\\setup.py'"'"'; __file__='"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-hw6a8m3j\\pyyaml\\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\Owlsoul\AppData\Local\Temp\pip-record-v7hld7x2\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Owlsoul\.local\include\python3.8\pyyaml' Check the logs for full command output.
Thanks in advance for your help.
After following your advice, a new error has popped up:
C:\Users\Owlsoul>pip install torch
Defaulting to user installation because normal site-packages is not writeable
Collecting torch
Using cached torch-0.1.2.post2.tar.gz (128 kB)
Requirement already satisfied: pyyaml in c:\users\owlsoul\appdata\roaming\python\python38\site-packages (from torch) (5.3.1)
Building wheels for collected packages: torch
Building wheel for torch (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\program files (x86)\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-jio16_76\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-jio16_76\\torch\\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\Owlsoul\AppData\Local\Temp\pip-wheel-iuye_5re'
cwd: C:\Users\Owlsoul\AppData\Local\Temp\pip-install-jio16_76\torch\
Complete output (30 lines):
running bdist_wheel
running build
running build_deps
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Owlsoul\AppData\Local\Temp\pip-install-jio16_76\torch\setup.py", line 225, in <module>
setup(name="torch", version="0.1.2.post2",
File "c:\program files (x86)\python38-32\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "c:\program files (x86)\python38-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\program files (x86)\python38-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\program files (x86)\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Owlsoul\AppData\Roaming\Python\Python38\site-packages\wheel\bdist_wheel.py", line 290, in run
self.run_command('build')
File "c:\program files (x86)\python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\program files (x86)\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\program files (x86)\python38-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\program files (x86)\python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\program files (x86)\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Owlsoul\AppData\Local\Temp\pip-install-jio16_76\torch\setup.py", line 51, in run
from tools.nnwrap import generate_wrappers as generate_nn_wrappers
ModuleNotFoundError: No module named 'tools.nnwrap'
----------------------------------------
ERROR: Failed building wheel for torch
Running setup.py clean for torch
ERROR: Command errored out with exit status 1:
command: 'c:\program files (x86)\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-jio16_76\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-jio16_76\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
cwd: C:\Users\Owlsoul\AppData\Local\Temp\pip-install-jio16_76\torch
Complete output (2 lines):
running clean
error: [Errno 2] No such file or directory: '.gitignore'
----------------------------------------
ERROR: Failed cleaning build dir for torch
Failed to build torch
Installing collected packages: torch
Running setup.py install for torch ... error
ERROR: Command errored out with exit status 1:
command: 'c:\program files (x86)\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-jio16_76\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-jio16_76\\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\Owlsoul\AppData\Local\Temp\pip-record-z9idl5pc\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Owlsoul\AppData\Roaming\Python\Python38\Include\torch'
cwd: C:\Users\Owlsoul\AppData\Local\Temp\pip-install-jio16_76\torch\
Complete output (23 lines):
running install
running build_deps
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Owlsoul\AppData\Local\Temp\pip-install-jio16_76\torch\setup.py", line 225, in <module>
setup(name="torch", version="0.1.2.post2",
File "c:\program files (x86)\python38-32\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "c:\program files (x86)\python38-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\program files (x86)\python38-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\program files (x86)\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Owlsoul\AppData\Local\Temp\pip-install-jio16_76\torch\setup.py", line 99, in run
self.run_command('build_deps')
File "c:\program files (x86)\python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\program files (x86)\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Owlsoul\AppData\Local\Temp\pip-install-jio16_76\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:\program files (x86)\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-jio16_76\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Owlsoul\\AppData\\Local\\Temp\\pip-install-jio16_76\\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\Owlsoul\AppData\Local\Temp\pip-record-z9idl5pc\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Owlsoul\AppData\Roaming\Python\Python38\Include\torch' Check the logs for full command output.

Note that your error is caused by c:\program files\inkscape\bin\python.exe, which is almost certainly entirely the wrong python executable, because that's not where python installs itself.
Uninstall whatever you installed, then grab the latest installer from https://www.python.org/downloads/windows/, run that (with admin rights, because hopefully you remembered to make sure your own account is set to a normal account type and NOT an admin account, for obvious security reasons), then when that's finished installing, make sure to update your PATH:
run "advanced system settings"
click the "environment variables" button
double click the PATH entry in "system variables" section
verify that both C:\Program Files\Python38\ and C:\Program Files\Python38\Scripts\ are in there. If not, add them. (or whatever the location is you custom-installed them to of course).
possibly necessary: also check to see if there is an Inkscape entry in your Path. If there is, use the "move up"/"move down" buttons to make sure that the Python entries are listed above the Inkscape entry.
Then you can start cmd/powershell/etc with admin rights (if you already had one open, close it and start a new one for the updated PATH to be in effect) and just use pip (not pip3) to install packages globally.
That said, for projects you almost always want to use python's "virtualenv" concept, explained over on https://docs.python.org/3/tutorial/venv.html, which lets you install dependencies locally, which means that if one project requires, say, Django 2.10 and another requires Djangoo 3.0, each of them installs in their own virtual environment, instead of causing a global dependency conflict.

In the end, I ended up using anaconda and it worked. Thanks a lot, but setting these things up drives me nuts and I may not have the skill to understand a lot of the instructions...

Related

python wmm2020 module importing error, what is the issue? [duplicate]

Facing the following error while installing dlib for the OpenCV project. It shows that
CMake must be installed to build the following extensions: dlib.
Command Output:
Collecting dlib==19.18.0
Using cached dlib-19.18.0.tar.gz (3.1 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: 'D:\Install Drive\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\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\mahmu\AppData\Local\Temp\pip-record-mjm6k3c3\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Install Drive\Include\dlib'
cwd: C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\
Complete output (57 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
Traceback (most recent call last):
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "D:\Install Drive\lib\subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "D:\Install Drive\lib\subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "D:\Install Drive\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "D:\Install Drive\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
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\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 223, in <module>
setup(
File "D:\Install Drive\lib\site-packages\setuptools\__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "D:\Install Drive\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\Install Drive\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "D:\Install Drive\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Install Drive\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "D:\Install Drive\lib\distutils\command\install.py", line 546, in run
self.run_command('build')
File "D:\Install Drive\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Install Drive\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Install Drive\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "D:\Install Drive\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Install Drive\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 122, in get_cmake_version
raise RuntimeError("\n*******************************************************************\n" +
RuntimeError:
*******************************************************************
CMake must be installed to build the following extensions: dlib
*******************************************************************
----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\Install Drive\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\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\mahmu\AppData\Local\Temp\pip-record-mjm6k3c3\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Install Drive\Include\dlib' Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 21.1.2 is available.
You should consider upgrading via the 'D:\Install Drive\python.exe -m pip install --upgrade pip' command.
Notice that in the output that "CMake must be installed to build the following extensions: dlib". So install CMake first and only then try to install dlib. If CMake is installed, try updating your pip version to 21.1.2 via "D:\Install Drive\python.exe -m pip install --upgrade pip".
It requires cmake must be installed before installing dlib. Do execute in the following order.
pip install cmake
pip install dlib
This will fix the issue.

pip install error when trying to install face_recognition module [duplicate]

This question already has answers here:
An error occurred while installing face_recognition Error text: Collecting face_recognition
(5 answers)
Closed 2 years ago.
I have a problem when trying to install the face_recognition module using the commandprompt, I used pip install face_recognition, but I get a error and I can't resolve it myself. Anyone who can help?
I installed python through Microsoft studios (Python 3.8).
My pip version is 20.2.1
I also tried pip install face_recognition=1.3.0
My error is right here:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Bruger\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Bruger\\AppData\\Local\\Temp\\pip-install-hoq7h4eo\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Bruger\\AppData\\Local\\Temp\\pip-install-hoq7h4eo\\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\Bruger\AppData\Local\Temp\pip-record-w68bakhl\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Bruger\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\dlib'
cwd: C:\Users\Bruger\AppData\Local\Temp\pip-install-hoq7h4eo\dlib\
Complete output (55 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
Traceback (most recent call last):
File "C:\Users\Bruger\AppData\Local\Temp\pip-install-hoq7h4eo\dlib\setup.py", line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 489, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
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\Bruger\AppData\Local\Temp\pip-install-hoq7h4eo\dlib\setup.py", line 223, in <module>
setup(
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.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.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.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.8_3.8.1776.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.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Bruger\AppData\Local\Temp\pip-install-hoq7h4eo\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\Bruger\AppData\Local\Temp\pip-install-hoq7h4eo\dlib\setup.py", line 122, in get_cmake_version
raise RuntimeError("\n*******************************************************************\n" +
RuntimeError:
*******************************************************************
CMake must be installed to build the following extensions: _dlib_pybind11
*******************************************************************
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Bruger\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Bruger\\AppData\\Local\\Temp\\pip-install-hoq7h4eo\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Bruger\\AppData\\Local\\Temp\\pip-install-hoq7h4eo\\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\Bruger\AppData\Local\Temp\pip-record-w68bakhl\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Bruger\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\dlib' Check the logs for full command output.
Looks like you're missing a library that's required to build your dependencies.
CMake must be installed to build the following extensions: _dlib_pybind11
Install CMake and try installing face_recognition again.
It looks like you don't have the required Libraries
Run pip install cmake , and then pip install dlib. I guess now you will no longer receive the error...
This will install the requirements.

How to use pydensecrf in Python3.7?

I am running the following python code
import numpy as np
import pydensecrf.densecrf as dcrf
import matplotlib.pyplot as plt
which results in
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-4-cbaa174fb5e7> in <module>
1 import numpy as np
----> 2 import pydensecrf.densecrf as dcrf
3 import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'pydensecrf'
I have tried installing: pip install pydensecrf
But whenever I do, i get the following error
C:\Users\Aparajita Das>pip install pydensecrf
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/pydensecrf/
Collecting pydensecrf
Using cached pydensecrf-1.0rc3.tar.gz (1.0 MB)
Building wheels for collected packages: pydensecrf
Building wheel for pydensecrf (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Aparajita Das\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\APARAJ~1\\AppData\\Local\\Temp\\pip-install-pqhh72by\\pydensecrf\\setup.py'"'"'; __file__='"'"'C:\\Users\\APARAJ~1\\AppData\\Local\\Temp\\pip-install-pqhh72by\\pydensecrf\\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\APARAJ~1\AppData\Local\Temp\pip-wheel-v3toa6sn'
cwd: C:\Users\APARAJ~1\AppData\Local\Temp\pip-install-pqhh72by\pydensecrf\
Complete output (44 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\pydensecrf
copying pydensecrf\utils.py -> build\lib.win-amd64-3.7\pydensecrf
copying pydensecrf\__init__.py -> build\lib.win-amd64-3.7\pydensecrf
running build_ext
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\APARAJ~1\AppData\Local\Temp\pip-install-pqhh72by\pydensecrf\setup.py", line 41, in <module>
"Topic :: Scientific/Engineering :: Artificial Intelligence",
File "C:\Users\Aparajita Das\Anaconda3\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Aparajita Das\Anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
self.run_command('build')
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Aparajita Das\Anaconda3\lib\site-packages\setuptools\command\build_ext.py", line 87, in run
_build_ext.run(self)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\command\build_ext.py", line 309, in run
force=self.force)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\ccompiler.py", line 1031, in new_compiler
return klass(None, dry_run, force)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\cygwinccompiler.py", line 285, in __init__
CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\cygwinccompiler.py", line 129, in __init__
if self.ld_version >= "2.10.90":
TypeError: '>=' not supported between instances of 'NoneType' and 'str'
----------------------------------------
ERROR: Failed building wheel for pydensecrf
Running setup.py clean for pydensecrf
Failed to build pydensecrf
Installing collected packages: pydensecrf
Running setup.py install for pydensecrf ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Aparajita Das\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\APARAJ~1\\AppData\\Local\\Temp\\pip-install-pqhh72by\\pydensecrf\\setup.py'"'"'; __file__='"'"'C:\\Users\\APARAJ~1\\AppData\\Local\\Temp\\pip-install-pqhh72by\\pydensecrf\\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\APARAJ~1\AppData\Local\Temp\pip-record-tms9_lds\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Aparajita Das\Anaconda3\Include\pydensecrf'
cwd: C:\Users\APARAJ~1\AppData\Local\Temp\pip-install-pqhh72by\pydensecrf\
Complete output (46 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\pydensecrf
copying pydensecrf\utils.py -> build\lib.win-amd64-3.7\pydensecrf
copying pydensecrf\__init__.py -> build\lib.win-amd64-3.7\pydensecrf
running build_ext
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\APARAJ~1\AppData\Local\Temp\pip-install-pqhh72by\pydensecrf\setup.py", line 41, in <module>
"Topic :: Scientific/Engineering :: Artificial Intelligence",
File "C:\Users\Aparajita Das\Anaconda3\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Aparajita Das\Anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Aparajita Das\Anaconda3\lib\site-packages\setuptools\command\build_ext.py", line 87, in run
_build_ext.run(self)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\command\build_ext.py", line 309, in run
force=self.force)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\ccompiler.py", line 1031, in new_compiler
return klass(None, dry_run, force)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\cygwinccompiler.py", line 285, in __init__
CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "C:\Users\Aparajita Das\Anaconda3\lib\distutils\cygwinccompiler.py", line 129, in __init__
if self.ld_version >= "2.10.90":
TypeError: '>=' not supported between instances of 'NoneType' and 'str'
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Aparajita Das\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\APARAJ~1\\AppData\\Local\\Temp\\pip-install-pqhh72by\\pydensecrf\\setup.py'"'"'; __file__='"'"'C:\\Users\\APARAJ~1\\AppData\\Local\\Temp\\pip-install-pqhh72by\\pydensecrf\\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\APARAJ~1\AppData\Local\Temp\pip-record-tms9_lds\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Aparajita Das\Anaconda3\Include\pydensecrf' Check the logs for full command output.
I am using Python 3.7.3 and I have cpython installed. I have checked everywhere and no solution is working for me. I have tried downgrading python, thinking it might work for older version using the following but it does not even downgrade it to the given version.
conda install python=3.5.0
How do I solve this?
For me installation failed with error: command 'gcc' failed with exit status 1.
This worked for me:
pip install cython
pip install git+https://github.com/lucasb-eyer/pydensecrf.git
Installing cython is the first thing you need to try out.That alone didn't work for me.Combination of both worked like a charm.
Referred to the comments at https://github.com/lucasb-eyer/pydensecrf/issues/78
Step1: download package of pydensecrf compatible with python version from link https://anaconda.org/conda-forge/pydensecrf/files?version=1.0rc2&page=2
Step2: Extract the package and copy two subfolders "pydensecrf and pydensecrf-1.0rc2.dist-info" in folder "Lib" to installed folder of python (Example: C:\Python 3.6\Lib\site-packages)

Fail to install dlib on windows10

Following a YouTube video about face recognition, I installed Python 3.8.2, then CMAKE, and then dlib. The dlib failed with the following message. At first I had python 32 bits, then I removed it and installed the 64 bit version, with same problem. Any idea?
I did the same flow on a another computer, with a similar error, that was solved after installing CMake. In this case CMake is installed.
What did I miss?
C:\Users\NH5>pip install dlib
Defaulting to user installation because normal site-packages is not writeable
Collecting dlib
Using cached dlib-19.19.0.tar.gz (3.2 MB)
Could not build wheels for dlib, since package 'wheel' is not installed.
Installing collected packages: dlib
Running setup.py install for dlib ... 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\\NH5\\AppData\\Local\\Temp\\pip-install-7c571567\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\NH5\\AppData\\Local\\Temp\\pip-install-7c571567\\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\NH5\AppData\Local\Temp\pip-record-wm_xgg14\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\NH5\AppData\Roaming\Python\Python38\Include\dlib'
cwd: C:\Users\NH5\AppData\Local\Temp\pip-install-7c571567\dlib\
Complete output (57 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\NH5\AppData\Local\Temp\pip-install-7c571567\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\NH5\AppData\Local\Temp\pip-install-7c571567\dlib\build\lib.win-amd64-3.8 -DPYTHON_EXECUTABLE=c:\program files\python38\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\NH5\AppData\Local\Temp\pip-install-7c571567\dlib\build\lib.win-amd64-3.8 -A x64'
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:3 (project):
Generator
NMake Makefiles
does not support platform specification, but platform
x64
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/NH5/AppData/Local/Temp/pip-install-7c571567/dlib/build/temp.win-amd64-3.8/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\NH5\AppData\Local\Temp\pip-install-7c571567\dlib\setup.py", line 223, in <module>
setup(
File "c:\program files\python38\lib\site-packages\setuptools\__init__.py", line 145, 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\NH5\AppData\Local\Temp\pip-install-7c571567\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\NH5\AppData\Local\Temp\pip-install-7c571567\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\\NH5\\AppData\\Local\\Temp\\pip-install-7c571567\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\NH5\\AppData\\Local\\Temp\\pip-install-7c571567\\dlib\\build\\lib.win-amd64-3.8', '-DPYTHON_EXECUTABLE=c:\\program files\\python38\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\NH5\\AppData\\Local\\Temp\\pip-install-7c571567\\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\\NH5\\AppData\\Local\\Temp\\pip-install-7c571567\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\NH5\\AppData\\Local\\Temp\\pip-install-7c571567\\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\NH5\AppData\Local\Temp\pip-record-wm_xgg14\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\NH5\AppData\Roaming\Python\Python38\Include\dlib' Check the logs for full command output.
C:\Users\NH5>
Try deepface. It is OS independent.
#!pip install deepface
from deepface import DeepFace
#face verification
obj = DeepFace.verify("img1.jpg", "img2.jpg")
#face recognition
df = DeepFace.find(img_path = "img1.jpg", db_path = "C:/workspace/my_db")
Find function looks for the identity of img1.jpg in my_db folder.

unable to install dlib in vs code it shows some installation error

i have used every solution that i can find in the internet but i am unable to install dlib in vs code please help me
pip install dlib --user
Collecting dlib
Using cached https://files.pythonhosted.org/packages/63/92/05c3b98636661cb80d190a5a777dd94effcc14c0f6893222e5ca81e74fbc/dlib-19.19.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... 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\\abhigna reddy\\AppData\\Local\\Temp\\pip-install-b3pu5qni\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\abhigna reddy\\AppData\\Local\\Temp\\pip-install-b3pu5qni\\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\abhigna reddy\AppData\Local\Temp\pip-record-dpfk1_ko\install-record.txt' --single-version-externally-managed --compile --user --prefix=
cwd: C:\Users\abhigna reddy\AppData\Local\Temp\pip-install-b3pu5qni\dlib\
Complete output (57 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\abhigna reddy\AppData\Local\Temp\pip-install-b3pu5qni\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\abhigna reddy\AppData\Local\Temp\pip-install-b3pu5qni\dlib\build\lib.win-amd64-3.8 -DPYTHON_EXECUTABLE=c:\program files\python38\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\abhigna reddy\AppData\Local\Temp\pip-install-b3pu5qni\dlib\build\lib.win-amd64-3.8 -A x64'
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:3 (project):
Generator
NMake Makefiles
does not support platform specification, but platform
x64
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/abhigna reddy/AppData/Local/Temp/pip-install-b3pu5qni/dlib/build/temp.win-amd64-3.8/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\abhigna reddy\AppData\Local\Temp\pip-install-b3pu5qni\dlib\setup.py", line 223, in <module>
setup(
File "c:\program files\python38\lib\site-packages\setuptools\__init__.py", line 145, 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\abhigna reddy\AppData\Local\Temp\pip-install-b3pu5qni\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\abhigna reddy\AppData\Local\Temp\pip-install-b3pu5qni\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\\abhigna reddy\\AppData\\Local\\Temp\\pip-install-b3pu5qni\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\abhigna reddy\\AppData\\Local\\Temp\\pip-install-b3pu5qni\\dlib\\build\\lib.win-amd64-3.8', '-DPYTHON_EXECUTABLE=c:\\program files\\python38\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\abhigna reddy\\AppData\\Local\\Temp\\pip-install-b3pu5qni\\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\\abhigna reddy\\AppData\\Local\\Temp\\pip-install-b3pu5qni\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\abhigna reddy\\AppData\\Local\\Temp\\pip-install-b3pu5qni\\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\abhigna reddy\AppData\Local\Temp\pip-record-dpfk1_ko\install-record.txt' --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.
you can install dlib for python 3.6
create a virtual environment for python 3.6
within virutualenv you can run below command
python -m pip install https://pypi.python.org/packages/da/06/bd3e241c4eb0a662914b3b4875fc52dd176a9db0d4a2c915ac2ad8800e9e/dlib-19.7.0-cp36-cp36m-win_amd64.whl#md5=b7330a5b2d46420343fbed5df69e6a3f

Categories

Resources