Unable to install django-toolkit with a python virtualenv - python

I'm relatively new to Python, Django and Heroku. I'm attempting to follow the instructions on setting up a Django Heroku project found here. I'm getting stuck at the following command:
$ pip install django-toolbelt
I get the following error
Requirement already satisfied (use --upgrade to upgrade): django-toolbelt in c:\
django\contactmanager\venv\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): django in c:\django\co
ntactmanager\venv\lib\site-packages (from django-toolbelt)
Downloading/unpacking psycopg2 (from django-toolbelt)
Running setup.py egg_info for package psycopg2
Downloading/unpacking gunicorn (from django-toolbelt)
Running setup.py egg_info for package gunicorn
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
warning: no previously-included files matching '*.pyc' found under directory
'tests'
warning: no previously-included files matching '*.pyo' found under directory
'tests'
warning: no previously-included files matching '*.pyc' found under directory
'examples'
warning: no previously-included files matching '*.pyo' found under directory
'examples'
Downloading/unpacking dj-database-url (from django-toolbelt)
Running setup.py egg_info for package dj-database-url
Downloading/unpacking dj-static (from django-toolbelt)
Running setup.py egg_info for package dj-static
Downloading/unpacking static (from dj-static->django-toolbelt)
Running setup.py egg_info for package static
Downloading/unpacking pystache (from static->dj-static->django-toolbelt)
Running setup.py egg_info for package pystache
pystache: using: version '0.6' of <module 'setuptools' from 'C:\Django\conta
ctmanager\venv\lib\site-packages\distribute-0.6.34-py2.7.egg\setuptools\__init__
.pyc'>
Installing collected packages: psycopg2, gunicorn, dj-database-url, dj-static, s
tatic, pystache
Running setup.py install for psycopg2
building 'psycopg2._psycopg' extension
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Django\contactmanager\venv\build\psycopg2\setup.py", line 568, in
<module>
ext_modules=ext)
File "C:\Python27\Lib\distutils\core.py", line 152, 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:\Django\contactmanager\venv\lib\site-packages\distribute-0.6.34-py
2.7.egg\setuptools\command\install.py", line 53, in run
return _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:\Python27\Lib\distutils\command\build_ext.py", line 337, in run
self.build_extensions()
File "C:\Python27\Lib\distutils\command\build_ext.py", line 446, in build_
extensions
self.build_extension(ext)
File "C:\Django\contactmanager\venv\build\psycopg2\setup.py", line 284, in
build_extension
build_ext.build_extension(self, extension)
File "C:\Python27\Lib\distutils\command\build_ext.py", line 496, in build_
extension
depends=ext.depends)
File "C:\Python27\Lib\distutils\msvc9compiler.py", line 473, in compile
self.initialize()
File "C:\Python27\Lib\distutils\msvc9compiler.py", line 383, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python27\Lib\distutils\msvc9compiler.py", line 299, in query_vcva
rsall
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
Complete output from command C:\Django\contactmanager\venv\Scripts\python.ex
e -c "import setuptools;__file__='C:\\Django\\contactmanager\\venv\\build\\psyco
pg2\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file_
_, 'exec'))" install --record c:\users\hp\appdata\local\temp\pip-ka3mfj-record\i
nstall-record.txt --single-version-externally-managed --install-headers C:\Djang
o\contactmanager\venv\include\site\python2.7:
running install
running build
running build_py
running build_ext
building 'psycopg2._psycopg' extension
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Django\contactmanager\venv\build\psycopg2\setup.py", line 568, in <mo
dule>
ext_modules=ext)
File "C:\Python27\Lib\distutils\core.py", line 152, 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:\Django\contactmanager\venv\lib\site-packages\distribute-0.6.34-py2.7.
egg\setuptools\command\install.py", line 53, in run
return _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:\Python27\Lib\distutils\command\build_ext.py", line 337, in run
self.build_extensions()
File "C:\Python27\Lib\distutils\command\build_ext.py", line 446, in build_exte
nsions
self.build_extension(ext)
File "C:\Django\contactmanager\venv\build\psycopg2\setup.py", line 284, in bui
ld_extension
build_ext.build_extension(self, extension)
File "C:\Python27\Lib\distutils\command\build_ext.py", line 496, in build_exte
nsion
depends=ext.depends)
File "C:\Python27\Lib\distutils\msvc9compiler.py", line 473, in compile
self.initialize()
File "C:\Python27\Lib\distutils\msvc9compiler.py", line 383, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python27\Lib\distutils\msvc9compiler.py", line 299, in query_vcvarsal
l
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
----------------------------------------
Command C:\Django\contactmanager\venv\Scripts\python.exe -c "import setuptools;_
_file__='C:\\Django\\contactmanager\\venv\\build\\psycopg2\\setup.py';exec(compi
le(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --re
cord c:\users\hp\appdata\local\temp\pip-ka3mfj-record\install-record.txt --singl
e-version-externally-managed --install-headers C:\Django\contactmanager\venv\inc
lude\site\python2.7 failed with error code 1 in C:\Django\contactmanager\venv\bu
ild\psycopg2
Storing complete log in C:\Users\hp\pip\pip.log
According to this link I'm supposed to install python-dev, python-psycopg2, libpq-dev before installing django-toolbelt.
I'm on a Windows machine. How can I install these dependencies? I tried installing them with pip but that doesn't work.

Apparently psycopg2 installers do not work under a virtualenv environment. I downloaded an executable binary from http://stickpeople.com/projects/python/win-psycopg/
To install the native binary in a virtual envrionment, use easy_install:
C:\virtualenv\Scripts\> activate.bat
(virtualenv) C:\virtualenv\Scripts\> easy_install psycopg2-2.5.win32-py2.7-pg9.2.4-release.exe

This blog post seems useful for your case:
http://www.swarley.me.uk/blog/2014/02/24/create-a-django-development-environment-on-64-bit-windows-for-heroku-deployment/
Or you can just find the windows ports for these dependency packages.

Related

Problem with installing dlib python 3.9.6

PS C:\Deepankar\Projects\VaibhavBhaiya-IntruderDetection\PHASE-II> pip install face recognition
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting face
Downloading face-22.0.0-py3-none-any.whl (54 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.5/54.5 kB 177.1 kB/s eta 0:00:00
ERROR: Could not find a version that satisfies the requirement recognition (from versions: none)
ERROR: No matching distribution found for recognition
[notice] A new release of pip is available: 23.0 -> 23.0.1
[notice] To update, run: python.exe -m pip install --upgrade pip
PS C:\Deepankar\Projects\VaibhavBhaiya-IntruderDetection\PHASE-II> python.exe -m pip install --upgrade pip
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Requirement already satisfied: pip in c:\users\deepa\appdata\local\programs\python\python39\lib\site-packages (23.0)
Collecting pip
Downloading pip-23.0.1-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 1.2 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 23.0
Uninstalling pip-23.0:
Successfully uninstalled pip-23.0
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\Users\deepa\AppData\Local\Temp\pip-uninstall-1kkyucgz\pip.exe'
Consider using the --user option or check the permissions.
PS C:\Deepankar\Projects\VaibhavBhaiya-IntruderDetection\PHASE-II> python.exe -m pip install --user --upgrade pip
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Requirement already satisfied: pip in c:\users\deepa\appdata\local\programs\python\python39\lib\site-packages (23.0.1)
PS C:\Deepankar\Projects\VaibhavBhaiya-IntruderDetection\PHASE-II> pip install dlib
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting dlib
Downloading dlib-19.24.0.tar.gz (3.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 103.2 kB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [68 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cmake_version) < '3.1.0':
Building extension for Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\build\lib.win-amd64-cpython-39 -DPYTHON_EXECUTABLE=C:\Users\deepa\AppData\Local\Programs\Python\Python39\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\build\lib.win-amd64-cpython-39 -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 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\setup.py", line 222, in <module>
setup(
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
super().run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
super().run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
super().run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\deepa\\AppData\\Local\\Temp\\pip-install-hakhwrt8\\dlib_d175b3b197704551a11d650b52da49e5\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\deepa\\AppData\\Local\\Temp\\pip-install-hakhwrt8\\dlib_d175b3b197704551a11d650b52da49e5\\build\\lib.win-amd64-cpython-39', '-DPYTHON_EXECUTABLE=C:\\Users\\deepa\\AppData\\Local\\Programs\\Python\\Python39\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\deepa\\AppData\\Local\\Temp\\pip-install-hakhwrt8\\dlib_d175b3b197704551a11d650b52da49e5\\build\\lib.win-amd64-cpython-39', '-A', 'x64']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
Running setup.py install for dlib ... error
error: subprocess-exited-with-error
× Running setup.py install for dlib did not run successfully.
│ exit code: 1
╰─> [72 lines of output]
running install
C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
running build_ext
C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cmake_version) < '3.1.0':
Building extension for Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\build\lib.win-amd64-cpython-39 -DPYTHON_EXECUTABLE=C:\Users\deepa\AppData\Local\Programs\Python\Python39\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\build\lib.win-amd64-cpython-39 -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 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\setup.py", line 222, in <module>
setup(
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
super().run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\command\install.py", line 68, in run
return orig.install.run(self)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\command\install.py", line 698, in run
self.run_command('build')
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
super().run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
super().run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\deepa\AppData\Local\Temp\pip-install-hakhwrt8\dlib_d175b3b197704551a11d650b52da49e5\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\deepa\\AppData\\Local\\Temp\\pip-install-hakhwrt8\\dlib_d175b3b197704551a11d650b52da49e5\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\deepa\\AppData\\Local\\Temp\\pip-install-hakhwrt8\\dlib_d175b3b197704551a11d650b52da49e5\\build\\lib.win-amd64-cpython-39', '-DPYTHON_EXECUTABLE=C:\\Users\\deepa\\AppData\\Local\\Programs\\Python\\Python39\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\deepa\\AppData\\Local\\Temp\\pip-install-hakhwrt8\\dlib_d175b3b197704551a11d650b52da49e5\\build\\lib.win-amd64-cpython-39', '-A', 'x64']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> dlib
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
PS C:\Deepankar\Projects\VaibhavBhaiya-IntruderDetection\PHASE-II> pip install face-recognition
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting face-recognition
Downloading face_recognition-1.3.0-py2.py3-none-any.whl (15 kB)
Requirement already satisfied: numpy in c:\users\deepa\appdata\roaming\python\python39\site-packages (from face-recognition) (1.22.2)
Requirement already satisfied: Click>=6.0 in c:\users\deepa\appdata\roaming\python\python39\site-packages (from face-recognition) (8.0.4)
Requirement already satisfied: Pillow in c:\users\deepa\appdata\roaming\python\python39\site-packages (from face-recognition) (9.0.1)
Collecting dlib>=19.7
Downloading dlib-19.24.0.tar.gz (3.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 160.1 kB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Requirement already satisfied: face-recognition-models>=0.3.0 in c:\users\deepa\appdata\local\programs\python\python39\lib\site-packages (from face-recognition) (0.3.0)
Requirement already satisfied: colorama in c:\users\deepa\appdata\roaming\python\python39\site-packages (from Click>=6.0->face-recognition) (0.4.4)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [68 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cmake_version) < '3.1.0':
Building extension for Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\build\lib.win-amd64-cpython-39 -DPYTHON_EXECUTABLE=C:\Users\deepa\AppData\Local\Programs\Python\Python39\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\build\lib.win-amd64-cpython-39 -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 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\setup.py", line 222, in <module>
setup(
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
super().run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
super().run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
super().run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\deepa\\AppData\\Local\\Temp\\pip-install-fv7x7lx3\\dlib_b7cc73b6dfd4410ea3e6b763453889d8\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\deepa\\AppData\\Local\\Temp\\pip-install-fv7x7lx3\\dlib_b7cc73b6dfd4410ea3e6b763453889d8\\build\\lib.win-amd64-cpython-39', '-DPYTHON_EXECUTABLE=C:\\Users\\deepa\\AppData\\Local\\Programs\\Python\\Python39\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\deepa\\AppData\\Local\\Temp\\pip-install-fv7x7lx3\\dlib_b7cc73b6dfd4410ea3e6b763453889d8\\build\\lib.win-amd64-cpython-39', '-A', 'x64']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib, face-recognition
Running setup.py install for dlib ... error
error: subprocess-exited-with-error
× Running setup.py install for dlib did not run successfully.
│ exit code: 1
╰─> [72 lines of output]
running install
C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
running build_ext
C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cmake_version) < '3.1.0':
Building extension for Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\build\lib.win-amd64-cpython-39 -DPYTHON_EXECUTABLE=C:\Users\deepa\AppData\Local\Programs\Python\Python39\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\build\lib.win-amd64-cpython-39 -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 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\setup.py", line 222, in <module>
setup(
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
super().run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\command\install.py", line 68, in run
return orig.install.run(self)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\command\install.py", line 698, in run
self.run_command('build')
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
super().run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
super().run_command(command)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\deepa\AppData\Local\Temp\pip-install-fv7x7lx3\dlib_b7cc73b6dfd4410ea3e6b763453889d8\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\deepa\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\deepa\\AppData\\Local\\Temp\\pip-install-fv7x7lx3\\dlib_b7cc73b6dfd4410ea3e6b763453889d8\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\deepa\\AppData\\Local\\Temp\\pip-install-fv7x7lx3\\dlib_b7cc73b6dfd4410ea3e6b763453889d8\\build\\lib.win-amd64-cpython-39', '-DPYTHON_EXECUTABLE=C:\\Users\\deepa\\AppData\\Local\\Programs\\Python\\Python39\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\deepa\\AppData\\Local\\Temp\\pip-install-fv7x7lx3\\dlib_b7cc73b6dfd4410ea3e6b763453889d8\\build\\lib.win-amd64-cpython-39', '-A', 'x64']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> dlib
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Trying to install face-recognition

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)

Lief won't install | couldn't build wheel for lief

I got lief working just fine on my Desktop (windows), but it refuses to install on my MacBook. I'm newer to Python development and installing new libraries, so maybe there's something I'm missing. I have Python 3.6 and 3.7 on my machine (is that a possible issue?). Lief appears to have support for Python 3.6, but I can't seem to install it using "pip install lief" or "pip3 install lief". I've updated setuptools but that doesn't seem to make any difference, either.
Terminal:
[Bens-MacBook-Pro-2:Downloads bluchterhand$ pip3 install lief
Collecting lief
Using cached https://files.pythonhosted.org/packages/cd/0e/0d6f3357975dd1530aeb4b4a84a99d493775391758378fb5109f47b613f9/lief-0.9.0.zip
Building wheels for collected packages: lief
Building wheel for lief (setup.py) ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-install-g3m0_dgi/lief/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 /private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-wheel-mme5acjc --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.6
creating build/lib.macosx-10.6-intel-3.6/lief
copying lief/__init__.py -> build/lib.macosx-10.6-intel-3.6/lief
running build_ext
Url: https://github.com/lief-project/LIEF/releases/download/0.9.0/lief-0.9.0-py3.6-osx.egg
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)>
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-install-g3m0_dgi/lief/setup.py", line 285, in <module>
'sdist': lief_sdist
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 192, in run
self.run_command('build')
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 78, in run
_build_ext.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-install-g3m0_dgi/lief/setup.py", line 215, in build_extension
self._install_from_source_package()
File "/private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-install-g3m0_dgi/lief/setup.py", line 265, in _install_from_source_package
raise Exception("Unable to find {}".format(url))
Exception: Unable to find /Users/bluchterhand/lief-0.9.0-py3.6-osx.egg
----------------------------------------
Failed building wheel for lief
Running setup.py clean for lief
Failed to build lief
Installing collected packages: lief
Running setup.py install for lief ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-install-g3m0_dgi/lief/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-record-g3smg09m/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.6
creating build/lib.macosx-10.6-intel-3.6/lief
copying lief/__init__.py -> build/lib.macosx-10.6-intel-3.6/lief
running build_ext
Url: https://github.com/lief-project/LIEF/releases/download/0.9.0/lief-0.9.0-py3.6-osx.egg
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)>
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-install-g3m0_dgi/lief/setup.py", line 285, in <module>
'sdist': lief_sdist
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 78, in run
_build_ext.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-install-g3m0_dgi/lief/setup.py", line 215, in build_extension
self._install_from_source_package()
File "/private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-install-g3m0_dgi/lief/setup.py", line 265, in _install_from_source_package
raise Exception("Unable to find {}".format(url))
Exception: Unable to find /Users/bluchterhand/lief-0.9.0-py3.6-osx.egg
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-install-g3m0_dgi/lief/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-record-g3smg09m/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/hp/ggfhzr7n133cr3csm59kdvs80000gn/T/pip-install-g3m0_dgi/lief/
Most notably; it fails to build the wheel. I've installed wheel many times thinking the install might've been broken, but I don't think that's the case anymore. Anyone have any ideas?
As with everything I ever post to this site, I found a solution to the problem the moment I posted. I downloaded the egg file from github.com/lief-project/LIEF/releases and pasted it in the /Users/NAME directory... all good. Gonna leave this up for anyone else having similar issues...

Error While Installing Face_recognition in python3.5.2 windows 10?

I already have dlib 19.1.0 and open cv 3.4.5 and numpy,scipy packages with advanced version but by using
pip install face_recognition
im getting following errors..Please can anyone help me what i did wrongly..
Collecting face_recognition
Using cached https://files.pythonhosted.org/packages/3f/ed/ad9a28042f373d4633fc8b49109b623597d6f193d3bbbef7780a5ee8eef2/face_recognition-1.2.3-py2.py3-none-any.whl
Requirement already satisfied: numpy in c:\python35\lib\site-packages (from face_recognition) (1.15.4)
Collecting dlib>=19.7 (from face_recognition)
Using cached https://files.pythonhosted.org/packages/35/8d/e4ddf60452e2fb1ce3164f774e68968b3f110f1cb4cd353235d56875799e/dlib-19.16.0.tar.gz
Collecting face-recognition-models>=0.3.0 (from face_recognition)
Requirement already satisfied: Click>=6.0 in c:\python35\lib\site-packages (from face_recognition) (7.0)
Requirement already satisfied: Pillow in c:\python35\lib\site-packages (from face_recognition) (5.4.1)
Building wheels for collected packages: dlib
Running setup.py bdist_wheel for dlib ... error
Complete output from command c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rqlch36v\\dlib\\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\Admin\AppData\Local\Temp\pip-wheel-de03y7mf --python-tag cp35:
running bdist_wheel
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:\python35\lib\runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "c:\python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\python35\Scripts\cmake.exe\__main__.py", line 5, in <module>
ImportError: cannot import name 'cmake'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\setup.py", line 257, in <module>
'Topic :: Software Development',
File "c:\python35\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python35\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python35\lib\site-packages\wheel\bdist_wheel.py", line 188, in run
self.run_command('build')
File "c:\python35\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python35\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\python35\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\setup.py", line 127, in run
cmake_version = self.get_cmake_version()
File "C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\setup.py", line 118, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "c:\python35\lib\subprocess.py", line 626, in check_output
**kwargs).stdout
File "c:\python35\lib\subprocess.py", line 708, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['cmake', '--version']' returned non-zero exit status 1
----------------------------------------
Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib, face-recognition-models, face-recognition
Found existing installation: dlib 19.1.0
Uninstalling dlib-19.1.0:
Successfully uninstalled dlib-19.1.0
Running setup.py install for dlib ... error
Complete output from command c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rqlch36v\\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\Admin\AppData\Local\Temp\pip-record-tjyw2jml\install-record.txt --single-version-externally-managed --compile:
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:\python35\lib\runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "c:\python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\python35\Scripts\cmake.exe\__main__.py", line 5, in <module>
ImportError: cannot import name 'cmake'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\setup.py", line 257, in <module>
'Topic :: Software Development',
File "c:\python35\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python35\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python35\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\python35\lib\distutils\command\install.py", line 539, in run
self.run_command('build')
File "c:\python35\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python35\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\python35\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\setup.py", line 127, in run
cmake_version = self.get_cmake_version()
File "C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\setup.py", line 118, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "c:\python35\lib\subprocess.py", line 626, in check_output
**kwargs).stdout
File "c:\python35\lib\subprocess.py", line 708, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['cmake', '--version']' returned non-zero exit status 1
----------------------------------------
Rolling back uninstall of dlib
Command "c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-rqlch36v\\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\Admin\AppData\Local\Temp\pip-record-tjyw2jml\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Admin\AppData\Local\Temp\pip-install-rqlch36v\dlib\
Actually i tried with some other installation keywords and tried to rectified error but 'm getting same errors when i used pip install face_recognition and my python version is 3.5.2 and i tried with wheel files also with specified version of python and face_recognition.
Following wheel files are i have tried wheel files..
https://pypi.org/simple/face-recognition/
Hello for this problem make this
step 1:
pip install cmake dlib
step 2:
pip install face-recognition
If you have the problem by dlib check this
sudo apt install python3-dev

Why do I get an error when installing Pillow 3.0.0 on Ubuntu?

I recently failed trying to install Pillow 3.0.0 on my Ubuntu 14.04.
No matter what I do (download and try to sudo python setup.py install or sudo -H pip install Pillow==3.0.0 --no-cache-dir) every time I get error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-3waMkf/Pillow/setup.py", line 767, in <module>
zip_safe=not debug_build(),
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.7/dist-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
self.run_command('build')
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
self.run_command(cmd_name)
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/build_ext.py", line 337, in run
self.build_extensions()
File "/tmp/pip-build-3waMkf/Pillow/setup.py", line 515, in build_extensions
% (f, f))
ValueError: --enable-zlib requested but zlib not found, aborting.
----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-3waMkf/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-S_sHo7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-3waMkf/Pillow
Did you install the dependencies for pillow ? You can install them by
$ sudo apt-get build-dep python-imaging
$ sudo apt-get install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev

Categories

Resources