Command errored out with exit status one - python

I am installing qark in my pc(Windows 7) for testing purpose. I have installed python 3.7.2 and pip 19.2.3. For next step, I have to install the requirement.txt file while installing, an error occurred(Command errored out with exit status 1:) full error I will give below.
I tried installing it again but error was same I don't know what should I do. Help me.
Thank you
ERROR: Command errored out with exit status 1:
command: 'c:\users\hp\appdata\local\programs\python\python37\python.exe' -c
'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\HP\\AppData\\L
ocal\\Temp\\pip-install-6tjj0pbq\\cffi\\setup.py'"'"'; __file__='"'"'C:\\Users\\
HP\\AppData\\Local\\Temp\\pip-install-6tjj0pbq\\cffi\\setup.py'"'"';f=getattr(to
kenize, '"'"'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: C:\Users\HP\AppData\Local\Temp\pip-install-6tjj0pbq\cffi\
Complete output (27 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\HP\AppData\Local\Temp\pip-install-6tjj0pbq\cffi\setup.py",
line 120, in <module>
if sys.platform == 'win32' and uses_msvc():
File "C:\Users\HP\AppData\Local\Temp\pip-install-6tjj0pbq\cffi\setup.py",
line 98, in uses_msvc
return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
File "c:\users\hp\appdata\local\programs\python\python37\lib\distutils\com
mand\config.py", line 227, in try_compile
self._compile(body, headers, include_dirs, lang)
File "c:\users\hp\appdata\local\programs\python\python37\lib\distutils\com
mand\config.py", line 133, in _compile
self.compiler.compile([src], include_dirs=include_dirs)
File "c:\users\hp\appdata\local\programs\python\python37\lib\distutils\_ms
vccompiler.py", line 345, in compile
self.initialize()
File "c:\users\hp\appdata\local\programs\python\python37\lib\distutils\_ms
vccompiler.py", line 238, in initialize
vc_env = _get_vc_env(plat_spec)
File "c:\users\hp\appdata\local\programs\python\python37\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\hp\appdata\local\programs\python\python37\lib\site-packages
\setuptools\msvc.py", line 1228, in return_env
self.OSIncludes,
File "c:\users\hp\appdata\local\programs\python\python37\lib\site-packages
\setuptools\msvc.py", line 963, in OSIncludes
sdkver = self._sdk_subdir
File "c:\users\hp\appdata\local\programs\python\python37\lib\site-packages
\setuptools\msvc.py", line 1057, in _sdk_subdir
ucrtver = self.si.WindowsSdkLastVersion
File "c:\users\hp\appdata\local\programs\python\python37\lib\site-packages
\setuptools\msvc.py", line 604, in WindowsSdkLastVersion
self.WindowsSdkDir, 'lib'))
File "c:\users\hp\appdata\local\programs\python\python37\lib\site-packages
\setuptools\msvc.py", line 809, in _use_last_dir_name
for dir_name in reversed(os.listdir(path))
FileNotFoundError: [WinError 3] The system cannot find the path specified: '
C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check th
e logs for full command output.

I also had a similar problem in which the cmd/PowerShell told me that I was missing a version of Windows Visual C++, so I followed what was written on THIS site, so I didn't have this problem anymore (I also rebooted, for safety):
Install using any ONE of these choices:
Microsoft Build Tools for Visual Studio
Alternative link to Microsoft Build Tools for Visual Studio.
Offline installer: vs_buildtools.exe
Select: Workloads → C++ build tools.
Install options: select only the “Windows 10 SDK” (assuming the computer is Windows 10). Optionally, if you want to use MSVC cl.exe C/C++ compiler from the command line, additionally select the C++ build tools, which takes an additional 2 GB disk space.
Moreover, to avoid problems I preferred to install Python 2.7.13 or 3.6
because they are the ones with which it has been tested (as indicated by the requirements on the github page).
After which (again according to the instructions) I installed QARK using:
pip install -r requirements.txt
pip install . --user
In the end, to make it work I had to put in the path of the environment variables these definitions:
C:\Users\user\AppData\Roaming\Python\Scripts         (if you are using Python 2.x.x)
C:\Users\utente\AppData\Roaming\Python\Python36\Scripts   (if you are using Python 3.x.x)
After that I didn't have any problems running it.
I hope I have been helpful! 🤞

Related

Error in updating AWS cli to latest version

I'm trying to update AWS CLI to the latest version. I'm following the below AWS documentation:
Aws cli upgrade with sudo access
When I run the command:
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
I get a long python error, which I can't understand. What is the problem here?
Error message:
Deprecated Python version detected: Python 2.7
Starting July 15, 2021, the AWS CLI will no longer support this version of Python. To continue receiving service updates, bug fixes, and security updates please upgrade to Python 3.6 or later. More information can be found here: https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-python-2-7-in-aws-sdk-for-python-and-aws-cli-v1/
Running cmd: /bin/python virtualenv.py --no-download --python /bin/python /usr/local/aws
Running cmd: /usr/local/aws/bin/pip install --no-binary :all: --no-cache-dir --no-index --find-links file://. setuptools_scm-3.3.3.tar.gz
Traceback (most recent call last):
File "./awscli-bundle/install", line 270, in <module>
main()
File "./awscli-bundle/install", line 247, in main
pip_install_packages(opts.install_dir)
File "./awscli-bundle/install", line 167, in pip_install_packages
_install_setup_deps(pip_script, '.')
File "./awscli-bundle/install", line 184, in _install_setup_deps
pip_script, setup_package_dir, setuptools_scm_tarball))
File "./awscli-bundle/install", line 90, in run
p.returncode, cmd, output))
__main__.BadRCError: Bad rc (1) for cmd '/usr/local/aws/bin/pip install --no-binary :all: --no-cache-dir --no-index --find-links file://. setuptools_scm-3.3.3.tar.gz': Looking in links: file://.
Processing ./setuptools_scm-3.3.3.tar.gz
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: Command errored out with exit status 1:
command: /usr/local/aws/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-M9znG_/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-M9znG_/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 /tmp/pip-req-build-M9znG_/pip-egg-info
cwd: /tmp/pip-req-build-M9znG_/
Complete output (36 lines):
running egg_info
creating /tmp/pip-req-build-M9znG_/pip-egg-info/setuptools_scm.egg-info
writing /tmp/pip-req-build-M9znG_/pip-egg-info/setuptools_scm.egg-info/PKG-INFO
writing top-level names to /tmp/pip-req-build-M9znG_/pip-egg-info/setuptools_scm.egg-info/top_level.txt
writing dependency_links to /tmp/pip-req-build-M9znG_/pip-egg-info/setuptools_scm.egg-info/dependency_links.txt
writing entry points to /tmp/pip-req-build-M9znG_/pip-egg-info/setuptools_scm.egg-info/entry_points.txt
writing manifest file '/tmp/pip-req-build-M9znG_/pip-egg-info/setuptools_scm.egg-info/SOURCES.txt'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-M9znG_/setup.py", line 118, in <module>
setuptools.setup(**arguments)
File "/usr/local/aws/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/aws/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 296, in run
self.find_sources()
File "/usr/local/aws/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
mm.run()
File "/usr/local/aws/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 534, in run
self.add_defaults()
File "/usr/local/aws/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 574, in add_defaults
rcfiles = list(walk_revctrl())
File "/usr/local/aws/lib/python2.7/site-packages/setuptools/command/sdist.py", line 20, in walk_revctrl
for item in ep.load()(dirname):
File "/tmp/pip-req-build-M9znG_/src/setuptools_scm/integration.py", line 22, in find_files
command = ep.load()
File "/usr/local/aws/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2443, in load
return self.resolve()
File "/usr/local/aws/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2453, in resolve
raise ImportError(str(exc))
ImportError: 'module' object has no attribute 'FILES_COMMAND'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

installing python module on linux

I am trying to install the python module pyobjus (this is the one that fails to install another module).
But I always get some bug during installation. I tried to switch to other python versions, reinstall pip, use option --no-cache-dir, etc, but couldn't manage to get past this bug:
$ pip3 install pyobjus
Defaulting to user installation because normal site-packages is not writeable
Collecting pyobjus
Using cached pyobjus-1.2.0.tar.gz (165 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpoff64vmf
cwd: /tmp/pip-install-4k26drr5/pyobjus
Complete output (19 lines):
Pyobjus platform is linux
Traceback (most recent call last):
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 150, in get_requires_for_build_wheel
config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 130, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 254, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 35, in <module>
class PyObjusBuildExt(build_ext, object):
NameError: name 'build_ext' is not defined
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpoff64vmf Check the logs for full command output.
Any help would be greatly appreciated.
My OS is Linux Mint 19.3.
I saw this question which is about the same problem, but following the links did not bring any answer. It says PyObjus is designed for MacOS, but then why does the module katrain, supposedly compatible with linux, tries to install it when running "pip3 install katrain" (giving the same error as above) ?
Edit adter Marat's suggestion:
I removed the test for ios, the installation goes a bit further, but fails because Python.h is missing. when trying to install python3-dev, apt-get says that broken packages such as python3.6-dev are flagged "left as is", so it cannot install the required ones. Is there a way to fix the python installation, which seems to be broken ? I am afraid to break all the system if I mess up with it too much, but there is clearly a problem with my installation...
Fixed the above issue by reinstalling stuff, now it is CoreFoundation.h that is missing...

Error when I try to install matplotlib on my Mac for Python [duplicate]

OS: Windows 10
Python ver: 3.9.0
Error code:
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried:
python -m pip install -U pip
python -m pip install -U matplotlib
didn't work.
and then I tried:
pip install --upgrade setuptools
didn't solve the problem.
I read on SO that maybe if I open the shell in administrator mode it could solve the problem but it didn't work too.
I saw someone mentioning ez-setup for this error code. I installed it but that didn't work too.
I don't know if it has something to do but my C directory looks like this:
C:\Users\METİNUSTA
It has an uppercase i character which sometimes can cause problems with applications. I can't change it because I am using my school's Windows key and it don't let me do any change. Because of this I installed python on D: .
Also here my pip list for extra information:
ez-setup 0.9
flake8 3.8.4
mccabe 0.6.1
pip 20.2.4
pycodestyle 2.6.0
pyflakes 2.2.0
setuptools 50.3.2
wheel 0.35.1
and finally whole error log that I get on windows powershell:
ERROR: Command errored out with exit status 1:
command: 'd:\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\METİNUSTA\\AppData\\Local\\Temp\\pip-install-8iv10tb_\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\METİNUSTA\\AppData\\Local\\Temp\\pip-install-8iv10tb_\\matplotlib\\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 'C:\Users\METİNUSTA\AppData\Local\Temp\pip-pip-egg-info-elosrn6m'
cwd: C:\Users\METİNUSTA\AppData\Local\Temp\pip-install-8iv10tb_\matplotlib\
Complete output (99 lines):
WARNING: Missing build requirements in pyproject.toml for numpy>=1.15 from https://files.pythonhosted.org/packages/bf/e8/15aea783ea72e2d4e51e3ec365e8dc4a1a32c9e5eb3a6d695b0d58e67cdd/numpy-1.19.2.zip#sha256=0d310730e1e793527065ad7dde736197b705d0e4c9999775f212b03c44a8484c.
WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'setuptools>=40.8.0' and 'wheel'.
ERROR: Command errored out with exit status 1:
command: 'd:\python\python39\python.exe' 'd:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\METNUS~1\AppData\Local\Temp\tmpqz3brme_'
cwd: C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy
Complete output (49 lines):
Error in sitecustomize; set PYTHONVERBOSE for traceback:
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xdd in position 0: unexpected end of data (sitecustomize.py, line 21)
Running from numpy source directory.
setup.py:470: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
Error in sitecustomize; set PYTHONVERBOSE for traceback:
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xdd in position 0: unexpected end of data (sitecustomize.py, line 21)
Processing numpy/random\_bounded_integers.pxd.in
Processing numpy/random\bit_generator.pyx
Traceback (most recent call last):
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 59, in process_pyx
from Cython.Compiler.Version import version as cython_version
ModuleNotFoundError: No module named 'Cython'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 235, in <module>
main()
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 231, in main
find_process_files(root_dir)
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 222, in find_process_files
process(root_dir, fromfile, tofile, function, hash_db)
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 188, in process
processor_function(fromfile, tofile)
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 64, in process_pyx
raise OSError('Cython needs to be installed in Python as a module')
OSError: Cython needs to be installed in Python as a module
Cythonizing sources
Traceback (most recent call last):
File "d:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
main()
File "d:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "d:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 133, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "d:\python\python39\lib\site-packages\setuptools\build_meta.py", line 161, in prepare_metadata_for_build_wheel
self.run_setup()
File "d:\python\python39\lib\site-packages\setuptools\build_meta.py", line 253, in run_setup
super(_BuildMetaLegacyBackend,
File "d:\python\python39\lib\site-packages\setuptools\build_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 499, in <module>
setup_package()
File "setup.py", line 479, in setup_package
generate_cython()
File "setup.py", line 274, in generate_cython
raise RuntimeError("Running cythonize failed!")
RuntimeError: Running cythonize failed!
----------------------------------------
ERROR: Command errored out with exit status 1: 'd:\python\python39\python.exe' 'd:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\METNUS~1\AppData\Local\Temp\tmpqz3brme_' Check the logs for full command output.
Traceback (most recent call last):
File "d:\python\python39\lib\site-packages\setuptools\installer.py", line 126, in fetch_build_egg
subprocess.check_call(cmd)
File "d:\python\python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['d:\\python\\python39\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\METNUS~1\\AppData\\Local\\Temp\\tmppoh8r2c9', '--quiet', 'numpy>=1.15']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-install-8iv10tb_\matplotlib\setup.py", line 242, in <module>
setup( # Finally, pass this all along to distutils to do the heavy lifting.
File "d:\python\python39\lib\site-packages\setuptools\__init__.py", line 152, in setup
_install_setup_requires(attrs)
File "d:\python\python39\lib\site-packages\setuptools\__init__.py", line 147, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "d:\python\python39\lib\site-packages\setuptools\dist.py", line 673, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "d:\python\python39\lib\site-packages\pkg_resources\__init__.py", line 764, in resolve
dist = best[req.key] = env.best_match(
File "d:\python\python39\lib\site-packages\pkg_resources\__init__.py", line 1049, in best_match
return self.obtain(req, installer)
File "d:\python\python39\lib\site-packages\pkg_resources\__init__.py", line 1061, in obtain
return installer(requirement)
File "d:\python\python39\lib\site-packages\setuptools\dist.py", line 732, in fetch_build_egg
return fetch_build_egg(self, req)
File "d:\python\python39\lib\site-packages\setuptools\installer.py", line 128, in fetch_build_egg
raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['d:\\python\\python39\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\METNUS~1\\AppData\\Local\\Temp\\tmppoh8r2c9', '--quiet', 'numpy>=1.15']' returned non-zero exit status 1.
Edit setup.cfg to change the build options; suppress output with --quiet.
BUILDING MATPLOTLIB
matplotlib: yes [3.3.2]
python: yes [3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC
v.1927 64 bit (AMD64)]]
platform: yes [win32]
sample_data: yes [installing]
tests: no [skipping due to configuration]
macosx: no [Mac OS-X only]
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
python -m pip install --upgrade pip
pip install matplotlib==3.3.1
Worked for me.
edit: matplotlib has now released wheels for python 3.9 so pip install --upgrade matplotlib should work.
original answer
matplotlib hasn't made a wheel yet for version 3.9 so your python attempted to build it from source. You should downgrade to python 3.8 and then everything should work
This is because matplotlib has no 3.9 wheels ..
For convenience in the use of matplotlib, you can install anaconda.
In anaconda environment matplotlib, numpy and pandas are available by default for Python installed in Anaconda.
Or you can use lower versions of Python.
Install it from the source (Python >= 3.9.2):
git clone git://github.com/matplotlib/matplotlib.git
and build and install with:
cd matplotlib
python -mpip install .
If you want to be able to follow the development branch as it changes just replace the last step with:
python -mpip install -e .
Source and more information here: https://matplotlib.org/stable/faq/installing_faq.html#install-from-git
Matplotlib has no wheel for python version 3.10.
If tried installing matplotlib in 3.10 version of python by
pip install matplotlib
Results in : Error: Building wheel for matplotlib (setup.py)..error
Matplotlib dependencies are met and they are as follow:
cycler = 0.10
kiwisolver = 1.0.1
numpy = 1.16
pillow = 6.2.0
pyparsing = 2.2.1
six = 1.5
python-dateutil = 2.7
Tried upgrading pip and install matplotlib
python -m pip install -U pip
python -m pip install -U matplotlib
Successfully installed pip-21.3.1
again it didn't install Matplotlib.
Hence Down-versioned Python to 3.9 and installed Matplotlib. For Python version upto 3.9 wheel is defined for Matplotlib, do use Python 3.9 and make sure pip is upgraded to available version it wont be problem to install matplotlib

Python, Error while installing matplotlib

OS: Windows 10
Python ver: 3.9.0
Error code:
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried:
python -m pip install -U pip
python -m pip install -U matplotlib
didn't work.
and then I tried:
pip install --upgrade setuptools
didn't solve the problem.
I read on SO that maybe if I open the shell in administrator mode it could solve the problem but it didn't work too.
I saw someone mentioning ez-setup for this error code. I installed it but that didn't work too.
I don't know if it has something to do but my C directory looks like this:
C:\Users\METİNUSTA
It has an uppercase i character which sometimes can cause problems with applications. I can't change it because I am using my school's Windows key and it don't let me do any change. Because of this I installed python on D: .
Also here my pip list for extra information:
ez-setup 0.9
flake8 3.8.4
mccabe 0.6.1
pip 20.2.4
pycodestyle 2.6.0
pyflakes 2.2.0
setuptools 50.3.2
wheel 0.35.1
and finally whole error log that I get on windows powershell:
ERROR: Command errored out with exit status 1:
command: 'd:\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\METİNUSTA\\AppData\\Local\\Temp\\pip-install-8iv10tb_\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\METİNUSTA\\AppData\\Local\\Temp\\pip-install-8iv10tb_\\matplotlib\\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 'C:\Users\METİNUSTA\AppData\Local\Temp\pip-pip-egg-info-elosrn6m'
cwd: C:\Users\METİNUSTA\AppData\Local\Temp\pip-install-8iv10tb_\matplotlib\
Complete output (99 lines):
WARNING: Missing build requirements in pyproject.toml for numpy>=1.15 from https://files.pythonhosted.org/packages/bf/e8/15aea783ea72e2d4e51e3ec365e8dc4a1a32c9e5eb3a6d695b0d58e67cdd/numpy-1.19.2.zip#sha256=0d310730e1e793527065ad7dde736197b705d0e4c9999775f212b03c44a8484c.
WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'setuptools>=40.8.0' and 'wheel'.
ERROR: Command errored out with exit status 1:
command: 'd:\python\python39\python.exe' 'd:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\METNUS~1\AppData\Local\Temp\tmpqz3brme_'
cwd: C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy
Complete output (49 lines):
Error in sitecustomize; set PYTHONVERBOSE for traceback:
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xdd in position 0: unexpected end of data (sitecustomize.py, line 21)
Running from numpy source directory.
setup.py:470: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
Error in sitecustomize; set PYTHONVERBOSE for traceback:
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xdd in position 0: unexpected end of data (sitecustomize.py, line 21)
Processing numpy/random\_bounded_integers.pxd.in
Processing numpy/random\bit_generator.pyx
Traceback (most recent call last):
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 59, in process_pyx
from Cython.Compiler.Version import version as cython_version
ModuleNotFoundError: No module named 'Cython'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 235, in <module>
main()
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 231, in main
find_process_files(root_dir)
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 222, in find_process_files
process(root_dir, fromfile, tofile, function, hash_db)
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 188, in process
processor_function(fromfile, tofile)
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 64, in process_pyx
raise OSError('Cython needs to be installed in Python as a module')
OSError: Cython needs to be installed in Python as a module
Cythonizing sources
Traceback (most recent call last):
File "d:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
main()
File "d:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "d:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 133, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "d:\python\python39\lib\site-packages\setuptools\build_meta.py", line 161, in prepare_metadata_for_build_wheel
self.run_setup()
File "d:\python\python39\lib\site-packages\setuptools\build_meta.py", line 253, in run_setup
super(_BuildMetaLegacyBackend,
File "d:\python\python39\lib\site-packages\setuptools\build_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 499, in <module>
setup_package()
File "setup.py", line 479, in setup_package
generate_cython()
File "setup.py", line 274, in generate_cython
raise RuntimeError("Running cythonize failed!")
RuntimeError: Running cythonize failed!
----------------------------------------
ERROR: Command errored out with exit status 1: 'd:\python\python39\python.exe' 'd:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\METNUS~1\AppData\Local\Temp\tmpqz3brme_' Check the logs for full command output.
Traceback (most recent call last):
File "d:\python\python39\lib\site-packages\setuptools\installer.py", line 126, in fetch_build_egg
subprocess.check_call(cmd)
File "d:\python\python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['d:\\python\\python39\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\METNUS~1\\AppData\\Local\\Temp\\tmppoh8r2c9', '--quiet', 'numpy>=1.15']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-install-8iv10tb_\matplotlib\setup.py", line 242, in <module>
setup( # Finally, pass this all along to distutils to do the heavy lifting.
File "d:\python\python39\lib\site-packages\setuptools\__init__.py", line 152, in setup
_install_setup_requires(attrs)
File "d:\python\python39\lib\site-packages\setuptools\__init__.py", line 147, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "d:\python\python39\lib\site-packages\setuptools\dist.py", line 673, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "d:\python\python39\lib\site-packages\pkg_resources\__init__.py", line 764, in resolve
dist = best[req.key] = env.best_match(
File "d:\python\python39\lib\site-packages\pkg_resources\__init__.py", line 1049, in best_match
return self.obtain(req, installer)
File "d:\python\python39\lib\site-packages\pkg_resources\__init__.py", line 1061, in obtain
return installer(requirement)
File "d:\python\python39\lib\site-packages\setuptools\dist.py", line 732, in fetch_build_egg
return fetch_build_egg(self, req)
File "d:\python\python39\lib\site-packages\setuptools\installer.py", line 128, in fetch_build_egg
raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['d:\\python\\python39\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\METNUS~1\\AppData\\Local\\Temp\\tmppoh8r2c9', '--quiet', 'numpy>=1.15']' returned non-zero exit status 1.
Edit setup.cfg to change the build options; suppress output with --quiet.
BUILDING MATPLOTLIB
matplotlib: yes [3.3.2]
python: yes [3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC
v.1927 64 bit (AMD64)]]
platform: yes [win32]
sample_data: yes [installing]
tests: no [skipping due to configuration]
macosx: no [Mac OS-X only]
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
python -m pip install --upgrade pip
pip install matplotlib==3.3.1
Worked for me.
edit: matplotlib has now released wheels for python 3.9 so pip install --upgrade matplotlib should work.
original answer
matplotlib hasn't made a wheel yet for version 3.9 so your python attempted to build it from source. You should downgrade to python 3.8 and then everything should work
This is because matplotlib has no 3.9 wheels ..
For convenience in the use of matplotlib, you can install anaconda.
In anaconda environment matplotlib, numpy and pandas are available by default for Python installed in Anaconda.
Or you can use lower versions of Python.
Install it from the source (Python >= 3.9.2):
git clone git://github.com/matplotlib/matplotlib.git
and build and install with:
cd matplotlib
python -mpip install .
If you want to be able to follow the development branch as it changes just replace the last step with:
python -mpip install -e .
Source and more information here: https://matplotlib.org/stable/faq/installing_faq.html#install-from-git
Matplotlib has no wheel for python version 3.10.
If tried installing matplotlib in 3.10 version of python by
pip install matplotlib
Results in : Error: Building wheel for matplotlib (setup.py)..error
Matplotlib dependencies are met and they are as follow:
cycler = 0.10
kiwisolver = 1.0.1
numpy = 1.16
pillow = 6.2.0
pyparsing = 2.2.1
six = 1.5
python-dateutil = 2.7
Tried upgrading pip and install matplotlib
python -m pip install -U pip
python -m pip install -U matplotlib
Successfully installed pip-21.3.1
again it didn't install Matplotlib.
Hence Down-versioned Python to 3.9 and installed Matplotlib. For Python version upto 3.9 wheel is defined for Matplotlib, do use Python 3.9 and make sure pip is upgraded to available version it wont be problem to install matplotlib

Installing dlib with python 3.8 windows 10 error

I cant install dlib on python with cmd , I have downloaded cmake and putted it on PATH, or is there any plugin i have to download it first ? Or does my pip's environment is located at a wrong place ? Or do I have to change my python to 64 bit instead of 32 bit ? If I have to do so , please let me know the way to do it , I am a newbie
C:\Users\Yusuf>python -m pip install dlib --user
Collecting dlib
Using cached https://files.pythonhosted.org/packages/63/92/05c3b98636661cb80d190a5a777dd94effcc14c0f6893222e5ca81e74fbc/dlib-19.19.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\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\Yusuf\AppData\Local\Temp\pip-record-0h0t6gan\install-record.txt' --single-version-externally-managed --compile --user --prefix=
cwd: C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\
Complete output (65 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)]
Invoking CMake setup: 'cmake C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\build\lib.win32-3.8 -DPYTHON_EXECUTABLE=C:\Program Files (x86)\Python38-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\build\lib.win32-3.8'
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.24.28314.0
-- The CXX compiler identification is MSVC 19.24.28314.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: C:/Program Files (x86)/Python38-32/python.exe (found version "3.8")
CMake Error at C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/dlib/external/pybind11/tools/FindPythonLibsNew.cmake:124 (message):
Python config failure: Python is 32-bit, chosen compiler is 64-bit
Call Stack (most recent call first):
C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/dlib/external/pybind11/tools/pybind11Tools.cmake:16 (find_package)
C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/dlib/external/pybind11/CMakeLists.txt:33 (include)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/build/temp.win32-3.8/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py", line 223, in <module>
setup(
File "C:\Program Files (x86)\Python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Program Files (x86)\Python38-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files (x86)\Python38-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Program Files (x86)\Python38-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Program Files (x86)\Python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files (x86)\Python38-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Program Files (x86)\Python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Program Files (x86)\Python38-32\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\dlib\\build\\lib.win32-3.8', '-DPYTHON_EXECUTABLE=C:\\Program Files (x86)\\Python38-32\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\dlib\\build\\lib.win32-3.8']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Yusuf\\AppData\\Local\\Temp\\pip-install-lpo7_ajq\\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\Yusuf\AppData\Local\Temp\pip-record-0h0t6gan\install-record.txt' --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.
Please help me thank you !
NOTE:First make sure you have installed c++ compilers and cmake Then start following the sptes:
go to dlib on github
click on clone or download button and then download the package manually by clicking on the zip download And after the download finished , extract the file and put it in desktop
3.Then open Powershell or cmd
4.type in the command cd C:/users/(your username)/Desktop/master-dlib/master-dlib
5.Then when you changed your current working directory then type in the command python setup.py install
NOTE2: This is the manual way but also look into This Too.
go to python.org copy link location of latest binary executable or binary specific to your python version .
in cmd prompt typepython -m pip install +paste link location.
now run your .py file having dlib .

Categories