pyinstaller or any pip packages commands won't work - python

I keep getting this. Also whenever i try to upgrade pip it just stalls and sits on uninstalling forever.
How do i go about fixing this?
C:\Users\Jordan>pip install pyinstaller
Collecting pyinstaller
Using cached https://files.pythonhosted.org/packages/e2/c9/0b44b2ea87ba36395483a672fddd07e6a9cb2b8d3c4a28d7ae76c7e7e1e5/PyInstaller-3.5.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... error
Complete output from command "c:\program files (x86)\python37-32\python.exe" "c:\program files (x86)\python37-32\lib\site-packages\pip\_vendor\pep517\_in_process.py" get_requires_for_build_wheel C:\Users\Jordan\AppData\Local\Temp\tmpb_jok3bp:
Traceback (most recent call last):
File "c:\program files (x86)\python37-32\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 207, in <module>
main()
File "c:\program files (x86)\python37-32\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 197, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "c:\program files (x86)\python37-32\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 54, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\Jordan\AppData\Local\Temp\pip-build-env-4q5xlolk\overlay\Lib\site-packages\setuptools\build_meta.py", line 146, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "C:\Users\Jordan\AppData\Local\Temp\pip-build-env-4q5xlolk\overlay\Lib\site-packages\setuptools\build_meta.py", line 127, in _get_build_requires
self.run_setup()
File "C:\Users\Jordan\AppData\Local\Temp\pip-build-env-4q5xlolk\overlay\Lib\site-packages\setuptools\build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 20, in <module>
from PyInstaller import __version__ as version, HOMEPATH, PLATFORM
ModuleNotFoundError: No module named 'PyInstaller'
----------------------------------------
Command ""c:\program files (x86)\python37-32\python.exe" "c:\program files (x86)\python37-32\lib\site-packages\pip\_vendor\pep517\_in_process.py" get_requires_for_build_wheel C:\Users\Jordan\AppData\Local\Temp\tmpb_jok3bp" failed with error code 1 in C:\Users\Jordan\AppData\Local\Temp\pip-install-zhgjxcsa\pyinstaller
You are using pip version 19.0.1, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Try the following steps
Downgrade pip from version 19 to 18.1: pip install pip==18.1
Now install PyInstaller using following command: pip install pyinstaller
Once the pyinstaller installed you can upgrade your pip again :
python -m pip install --upgrade pip

Related

Python cannot install package berkeleydb, FileNotFoundError on Getting requirements to build wheel

Trying to install berkeleydb package for python on Windows.
Python 3.9.10
Pip 21.3.1
d:\pip install berkeleydb
Collecting berkeleydb
Using cached berkeleydb-18.1.5.tar.gz (430 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Admin\AppData\Local\Programs\Python\Python39\python.exe' 'C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\Admin\AppData\Local\Temp\tmpxcy8yhoh'
cwd: C:\Users\Admin\AppData\Local\Temp\pip-install-jxt67cx4\berkeleydb_a9b2c56166664d789a2f35b3ac5cfc73
Complete output (20 lines):
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-03j2vyim\overlay\Lib\site-packages\setuptools\build_meta.py", line 162, in get_requires_for_build_wheel
return self._get_build_requires(
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-03j2vyim\overlay\Lib\site-packages\setuptools\build_meta.py", line 143, in _get_build_requires
self.run_setup()
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-03j2vyim\overlay\Lib\site-packages\setuptools\build_meta.py", line 267, in run_setup
super(_BuildMetaLegacyBackend,
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-03j2vyim\overlay\Lib\site-packages\setuptools\build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 77, in <module>
import setup3
File "C:\Users\Admin\AppData\Local\Temp\pip-install-jxt67cx4\berkeleydb_a9b2c56166664d789a2f35b3ac5cfc73\setup3.py", line 346, in <module>
with open(os.path.join(incdir, 'db.h'), 'r') as f :
FileNotFoundError: [Errno 2] No such file or directory: 'db/include\\db.h'
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/c2/3f/a96d5caff3bbf0980fb47518ddb015a1df291f5ef31ee8c50ead21cb513a/berkeleydb-18.1.5.tar.gz#sha256=d8c2efbca9472f8848b13cce4f4904a5ea1e1540ee576e626a1491817832a50a (from https://pypi.org/simple/berkeleydb/). Command errored out with exit status 1: 'C:\Users\Admin\AppData\Local\Programs\Python\Python39\python.exe' 'C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\Admin\AppData\Local\Temp\tmpxcy8yhoh' Check the logs for full command output.
I have no clues anymore. Totally removed python from my system and reinstalled it. Also with pip install bsddb3 I get a similar problem. However, I could install pandas without problems.
You can try installing bsddb first as follows
pip install bsddb3-6.1.1-cp34-none-win_amd64.whl
if that does'nt work try this
$ sudo apt install libdb-dev
$ pip install bsddb3

Unable to install pandas using Python3.8

When I try to install pandas on a Linux machine, I run into the below issue. Please let me know what dependency am I missing here or if there is any other issue.
The same command worked fine when I installed with Python3
Python version - Python3.8
# python3.8 -m pip install pandas
Collecting pandas
Using cached https://files.pythonhosted.org/packages/99/f0/f99700ef327e51d291efdf4a6de29e685c4d198cbf8531541fc84d169e0e/pandas-1.3.5.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 188, in main
status = self.run(options, args)
File "/usr/local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 345, in run
resolver.resolve(requirement_set)
File "/usr/local/lib/python3.8/site-packages/pip/_internal/legacy_resolve.py", line 196, in resolve
self._resolve_one(requirement_set, req)
File "/usr/local/lib/python3.8/site-packages/pip/_internal/legacy_resolve.py", line 359, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python3.8/site-packages/pip/_internal/legacy_resolve.py", line 305, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(
File "/usr/local/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 214, in prepare_linked_requirement
abstract_dist.prepare_distribution_metadata(
File "/usr/local/lib/python3.8/site-packages/pip/_internal/distributions/source.py", line 70, in prepare_distribution_metadata
reqs = self.req.pep517_backend.get_requires_for_build_wheel()
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/wrappers.py", line 70, in get_requires_for_build_wheel
return self._call_hook('get_requires_for_build_wheel', {
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/wrappers.py", line 162, in _call_hook
raise BackendUnavailable
pip._vendor.pep517.wrappers.BackendUnavailable
WARNING: You are using pip version 19.2.3, however version 21.3.1 is available.
When executed as python3.8 -m pip install --no-use-pep517 pandas, observing below issue -
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xt3n6dn0/pandas/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xt3n6dn0/pandas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-xt3n6dn0/pandas/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 20, in <module>
from setuptools.dist import Distribution, Feature
File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line 35, in <module>
from setuptools import windows_support
File "/usr/local/lib/python3.8/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/usr/local/lib/python3.8/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Try:
python3.8 -m pip install --no-use-pep517 pandas
Maybe you should also upgrade pip and setuptools before:
python3.8 -m pip install -U pip setuptools
Try maybe
pip cache purge to clean all cached packages,
also you can try to install after the update of pip - pip install --upgrade pip.
If that does not help, try to make a virtual environment with your python3.8 and try to install packages inside that venv.

setuptools pip wheel failed with error code 2

I am going through the Google Cloud Platform's Python Bookshelf App Tutorial and I am at the step of starting up my virtualenv where I am stuck.
Running virtualenv -p python3 env produces this error:
⇒ virtualenv -p python3 env
Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
Using base prefix '/Library/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/puoygae/Lab/gae-bookshelf-app-python-flexible-experiment/getting-started-python/2-structured-data/env/bin/python3
Also creating executable in /Users/puoygae/Lab/gae-bookshelf-app-python-flexible-experiment/getting-started-python/2-structured-data/env/bin/python
Please make sure you remove any previous custom paths from your /Users/puoygae/.pydistutils.cfg file.
Installing setuptools, pip, wheel...
Complete output from command /Users/puoygae/Lab/ga...data/env/bin/python3 - setuptools pip wheel:
Collecting setuptools
Using cached https://files.pythonhosted.org/packages/75/b3/0a106dfaf7f48aef638da80b32608617cc8de4b24a22c8cd3759c32e5d30/setuptools-41.1.0-py2.py3-none-any.whl
Collecting pip
Using cached https://files.pythonhosted.org/packages/8d/07/f7d7ced2f97ca3098c16565efbe6b15fafcba53e8d9bdb431e09140514b0/pip-19.2.2-py2.py3-none-any.whl
Collecting wheel
Using cached https://files.pythonhosted.org/packages/bb/10/44230dd6bf3563b8f227dbf344c908d412ad2ff48066476672f3a72e174e/wheel-0.33.4-py2.py3-none-any.whl
Installing collected packages: setuptools, pip, wheel
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_set.py", line 731, in install
**kwargs
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_install.py", line 841, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_install.py", line 1040, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/wheel.py", line 343, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/wheel.py", line 321, in clobber
shutil.copyfile(srcfile, destfile)
File "/Users/puoygae/Lab/gae-bookshelf-app-python-flexible-experiment/getting-started-python/2-structured-data/env/lib/python3.6/shutil.py", line 121, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/lib/python3.6/site-packages/easy_install.py'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/virtualenv.py", line 2327, in <module>
main()
File "/Library/Python/2.7/site-packages/virtualenv.py", line 711, in main
symlink=options.symlink)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 944, in create_environment
download=download,
File "/Library/Python/2.7/site-packages/virtualenv.py", line 900, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 795, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/puoygae/Lab/ga...data/env/bin/python3 - setuptools pip wheel failed with error code 2
I had followed this guide to set up my python development environment. I searched the internet for a solution but I haven't had luck getting pass this step.
What is causing the issue and how can I fix it?
EDIT: Running it with sudo produces the following error:
⇒ sudo virtualenv -p python3 env
Password:
Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
Using base prefix '/Library/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/myUserName/Lab/gae-bookshelf-app-python-flexible-experiment/getting-started-python/2-structured-data/env/bin/python3
Not overwriting existing python script /Users/myUserName/Lab/gae-bookshelf-app-python-flexible-experiment/getting-started-python/2-structured-data/env/bin/python (you must use /Users/myUserName/Lab/gae-bookshelf-app-python-flexible-experiment/getting-started-python/2-structured-data/env/bin/python3)
Please make sure you remove any previous custom paths from your /Users/myUserName/.pydistutils.cfg file.
Installing setuptools, pip, wheel...
Complete output from command /Users/myUserName/Lab/ga...data/env/bin/python3 - setuptools pip wheel:
The directory '/Users/myUserName/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/myUserName/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/75/b3/0a106dfaf7f48aef638da80b32608617cc8de4b24a22c8cd3759c32e5d30/setuptools-41.1.0-py2.py3-none-any.whl (576kB)
Collecting pip
Downloading https://files.pythonhosted.org/packages/8d/07/f7d7ced2f97ca3098c16565efbe6b15fafcba53e8d9bdb431e09140514b0/pip-19.2.2-py2.py3-none-any.whl (1.4MB)
Collecting wheel
Downloading https://files.pythonhosted.org/packages/bb/10/44230dd6bf3563b8f227dbf344c908d412ad2ff48066476672f3a72e174e/wheel-0.33.4-py2.py3-none-any.whl
Installing collected packages: setuptools, pip, wheel
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_set.py", line 731, in install
**kwargs
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_install.py", line 841, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/req/req_install.py", line 1040, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/wheel.py", line 476, in move_wheel_files
generated.extend(maker.make(spec))
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 353, in make
self._make_script(entry, filenames, options=options)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 257, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 231, in _write_script
self._fileop.write_binary_file(outname, script_bytes)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/distlib/util.py", line 388, in write_binary_file
with open(path, 'wb') as f:
PermissionError: [Errno 1] Operation not permitted: '/bin/easy_install'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/virtualenv.py", line 2327, in <module>
main()
File "/Library/Python/2.7/site-packages/virtualenv.py", line 711, in main
symlink=options.symlink)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 944, in create_environment
download=download,
File "/Library/Python/2.7/site-packages/virtualenv.py", line 900, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 795, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/myUserName/Lab/ga...data/env/bin/python3 - setuptools pip wheel failed with error code 2
#puoygae fixed his issue by creating a new User account on his MacOS and installed python separately. The environment in his Admin account was convoluted.
Other fixes to this known issue can be :
Removing all virtualenv* things in
/usr/local/lib/python2.7/dist-packages/ and reinstalling it as per
this GitHub issue.
Uninstall any setuptools and wheels from pip. Also uninstall them
from the apt-get remove wheel setuptools virutalenv(if they exist,
In some cases wheels and setuptools both can exist and may conflict
with each other from pip and apt-get installations) > Download fresh
setuptools-35.0.2 from here and virutalenv-15.1.0 from here.
Install both the tools freshly.
Follow the instructions on updating openSSL here and then try
setting up a virtual environment using pip install.
Could try to open the system terminal and type pip install
virtualenv. Restart IDE.
Try installing pysocks - sudo pip install pysocks Use - unset
all_proxy Retry
Also you can try upgrading to platformio-ide 2.1.5
"setenv all_proxy https://proxy_here:port_here/". Solves the proxy
problem for not only this setup but for all installations.
Also have a look at this stackoverflow thread fixes for the
same issue.
Reference Links :
https://github.com/platformio/platformio-atom-ide/issues/1245
https://github.com/pypa/virtualenv/issues/876
I had this problem as well.
My pip was looking at a different repo, the one I created using AWS's CodeArtifact, which needs login and credentials.
In my case, all I needed to do was erase this file ~/.config/pip/pip.config

RuntimeError: CMake must be installed to build the following extensions: dlib

I have already installed CMake by pip install cmake and tried to install face_recognition but it still gives me a RuntimeError. I'm using 'Python 3.7.3, x32'
I also tried to install the dlib by pip install dlib since it is one of the reasons why I can't install face_recognition.
C:\Users\user>python -m pip install cmake
Requirement already satisfied: cmake in c:\users\user\appdata\roaming\python\python37\site-packages (3.14.4)
C:\Users\user>python -m pip install dlib
Collecting dlib
Using cached https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Complete output from command 'C:\Python\Python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-24vk6act\\dlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\user\AppData\Local\Temp\pip-record-yf2kdjpx\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Temp\pip-install-24vk6act\dlib\setup.py", line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "C:\Python\Python37\lib\subprocess.py", line 395, in check_output
**kwargs).stdout
File "C:\Python\Python37\lib\subprocess.py", line 472, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Python\Python37\lib\subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "C:\Python\Python37\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\user\AppData\Local\Temp\pip-install-24vk6act\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Python\Python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python\Python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Python\Python37\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Python\Python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\user\AppData\Local\Temp\pip-install-24vk6act\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\user\AppData\Local\Temp\pip-install-24vk6act\dlib\setup.py", line 125, in get_cmake_version
"\n*******************************************************************\n")
RuntimeError:
*******************************************************************
CMake must be installed to build the following extensions: dlib
*******************************************************************
----------------------------------------
ERROR: Command "'C:\Python\Python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-24vk6act\\dlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\user\AppData\Local\Temp\pip-record-yf2kdjpx\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip-install-24vk6act\dlib\
Download and install dlib wheel from here
Then pip install face_recognition
pip install cmake
In visual studio, Individual Components
tab,Visual C++ tools for Cmake checkbox under Compilers,build tools
and runtimes Section
On Visual Studio Command prompt run, pip install face_recognition
Source
What works for is ...
After getting lots of Red Errors, I run following
conda install -c conda-forge dlib
pip install cmake
pip install face_recognition
Even the error says me to reinstall VS Code for c++. but above sequential installation works.
Python version was 3.8
Try install dlib using conda
conda install -c conda-forge dlib
For me, non of the solutions didn't work. Then, I downloaded all libraries in face_recognition package manually (like "pip install dlib==19.7", "pip install Click". At last, I installed face recognition with this command "pip install --no-deps face_recognition"

Getting error code 1 while installing geopandas with pip

This is the error I get when trying to install geopandas using pip install geopandas. I'm using Python 3.7.
Collecting geopandas
Using cached https://files.pythonhosted.org/packages/24/11/d77c157c16909bd77557d00798b05a5b6615ed60acb5900fbe6a65d35e93/geopandas-0.4.0-py2.py3-none-any.whl
Collecting pyproj (from geopandas)
Using cached https://files.pythonhosted.org/packages/29/72/5c1888c4948a0c7b736d10e0f0f69966e7c0874a660222ed0a2c2c6daa9f/pyproj-1.9.5.1.tar.gz
Complete output from command python setup.py egg_info:
using bundled proj4..
Traceback (most recent call last):
File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 489, in _find_latest_available_vc_ver
return self.find_available_vc_vers()[-1]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\AVIMAT~1\AppData\Local\Temp\pip-install-hnb_xdmp\pyproj\setup.py", line 72, in <module>
objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
File "c:\users\public\anaconda3\lib\distutils\_msvccompiler.py", line 345, in compile
self.initialize()
File "c:\users\public\anaconda3\lib\distutils\_msvccompiler.py", line 238, in initialize
vc_env = _get_vc_env(plat_spec)
File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 185, in msvc14_get_vc_env
return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 843, in __init__
self.si = SystemInfo(self.ri, vc_ver)
File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 485, in __init__
self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 492, in _find_latest_available_vc_ver
raise distutils.errors.DistutilsPlatformError(err)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\AVIMAT~1\AppData\Local\Temp\pip-install-hnb_xdmp\pyproj\
I have already tried a bunch of other methods, like upgrading setuptools or downloading the Fiona and GDAL binary files, but none of them seem to work.
As the Traceback says: Download this
https://visualstudio.microsoft.com/downloads/
This will give you the C++ libs required by the lib that you're installing
The problem is in compiling pyproj. Try to install a pre-compiled binary from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyproj
this helped me out
pip install wheel
pip install pipwin
pipwin install numpy
pipwin install pandas
pipwin install shapely
pipwin install gdal
pipwin install fiona
pipwin install pyproj
pipwin install six
pipwin install rtree
pipwin install geopandas

Categories

Resources