I am not quite experienced using pip. When I tried to install some packages, I had this error and had no idea what that meant. This happened to multiple packages that I tried to install. Any suggestions would be appreciated.
sudo pip install mysql-python
Password:
WARNING: The directory '/Users/yzr/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting mysql-python
Downloading MySQL-python-1.2.5.zip (108 kB)
|████████████████████████████████| 108 kB 2.2 MB/s
ERROR: Command errored out with exit status 1:
command: /Users/yzr/opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-0kcqh5vw/mysql-python/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-0kcqh5vw/mysql-python/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 /private/tmp/pip-install-0kcqh5vw/mysql-python/pip-egg-info
cwd: /private/tmp/pip-install-0kcqh5vw/mysql-python/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-0kcqh5vw/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/private/tmp/pip-install-0kcqh5vw/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I’m assuming you are using an Unix system such as Linux or MacOS.
Maybe you are accidentally using the python2.7 version installed on your system.
You can use a specific version of python for pip with:
python3 -m pip install mysql-python
Let me explain myself, every MacOS or Linux system has two Python versions (2.7 and 3.x) by default, and both of those versions has a pip module related to it, in other words, you have a pip module for Python 2.7 and other pip module for Python 3.x.
However, I’m assuming you are using python3 for your project, therefore, you must specify the pip module to use.
Other way to avoid this problem is using a virtual environment manager, such as pipenv or built in virtualenv module.
It looks like your pip package doesn't have the module "ConfigParser" installed. You should be able to install it by running:
pip install ConfigParser
Alternatively, depending on your Python version, try installing mysqlclient instead:
pip install mysqlclient
Related
I want to use this github project as a library in my own project:
https://github.com/cubrink/Toornament.com-API
I tried py -3.8 -m pip install git+https://github.com/cubrink/Toornament.com-API.git but I get the following output:
Collecting git+https://github.com/cubrink/Toornament.com-API.git
Cloning https://github.com/cubrink/Toornament.com-API.git to c:\users\oliver\appdata\local\temp\pip-req-build-5s91hvbw
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Oliver\AppData\Local\Programs\Python\Python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Oliver\\AppData\\Local\\Temp\\pip-req-build-5s91hvbw\\setup.py'"'"'; __file__='"'"'C:\\Users\\Oliver\\AppData\\Local\\Temp\\pip-req-build-5s91hvbw\\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\Oliver\AppData\Local\Temp\pip-pip-egg-info-lk3f8w3n'
cwd: C:\Users\Oliver\AppData\Local\Temp\pip-req-build-5s91hvbw\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Oliver\AppData\Local\Programs\Python\Python38\lib\tokenize.py", line 392, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Oliver\\AppData\\Local\\Temp\\pip-req-build-5s91hvbw\\setup.py'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I have also tried py -3.8 -m pip install git+ssh://olpohl#github.com:cubrink/Toornament.com-API.git but I get this output:
Collecting git+ssh://****#github.com:cubrink/Toornament.com-API.git
Cloning ssh://****#github.com:cubrink/Toornament.com-API.git to c:\users\oliver\appdata\local\temp\pip-req-build-p71m2041
ERROR: Command errored out with exit status 128: git clone -q 'ssh://****#github.com:cubrink/Toornament.com-API.git' 'C:\Users\Oliver\AppData\Local\Temp\pip-req-build-p71m2041' Check the logs for full command output.
I can successfully install other github projects like this - but not the one I want to use. I have a feeling the "." period sign in the project name "Toornament.com-API" could cause problems but I am not sure.
Am I missing something? Is there another way I can import this as a library in my own project? Including it as a submodule seems like a bad workaround and a bit of an overkill for what I'm trying to do.
You can't "install" that repo with pip because it's lacking a setup.py file. https://packaging.python.org/tutorials/packaging-projects/
A workaround would be cloning the code and using it more manually. Best practice in this case would be treating it as a submodule within your own repo. https://git-scm.com/book/en/v2/Git-Tools-Submodules
As #effprime says, it's missing a setup.py file
Adding the repo as a submodule works, but pollutes your repository and is annoying if you want to use this dependency in multiple projects.
Which you've since added to your question
Including it as a submodule seems like a bad workaround and a bit of an overkill for what I'm trying to do
You can easily fork the repository, commit a minimal setup.py yourself and pip install from your fork
from setuptools import setup, find_packages
setup(name='tourny',
version='0.1.0',
packages=find_packages())
I'm trying to install gwsurrogate package and it need Numpy, so I tried to install it using pip and it said it was installed successfully. However I keep getting this error that "Polyfit is poorly conditioned":
>>> % pip3 install gwsurrogate
Collecting gwsurrogate
Using cached gwsurrogate-1.0.6.tar.gz (5.2 MB)
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-install-0_og_kv1/gwsurrogate/setup.py'"'"'; __file__='"'"'/private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-install-0_og_kv1/gwsurrogate/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 /private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-pip-egg-info-xbzt899i
cwd: /private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-install-0_og_kv1/gwsurrogate/
Complete output (10 lines):
init_dgelsd failed init
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-install-0_og_kv1/gwsurrogate/setup.py", line 39, in <module>
import numpy
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/__init__.py", line 286, in <module>
raise RuntimeError(msg)
RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
RankWarning: Polyfit may be poorly conditioned
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried to uninstall and reinstall Numpy but nothing changed.
Faced this on MacOS 11.1 (Python 3.9.1) while installing numpy as camelot/excalibur dependency. Got it fixed by first upgrading pip latest version:
python3 -m pip install --upgrade pip --user
Found the answer from here: macOS Big Sur python3 cannot import numpy due to polyfit error
If this does not help, you might want to describe what OS version you are on for getting more environment specific help.
well, i use windows and with PIP set up, you can use its command line for installing NumPY.
To install NumPy with the package manager for Python 3, run the following command:
pip install numpy
Pip downloads the NumPy package and notifies you it has been successfully installed.
To upgrade Pip on windows, enter the following in command prompt:
python -m pip install --upgrade pip
This command first uninstalls the old version of Pip and then installs the most current version of Pip.
After the installation, you can use the show command to verify whether NumPy is now part of your Python packages. Run the following command:
pip3 show numpy
the output should confirm you have Numpy, which version you are using, as well as where the package is stored.
this should get your NumPy installed on windows. if you want a more step by step breakdown on how to go about this, you can find that here
https://www.thewindowsclub.com/how-to-install-numpy-using-pip-on-windows-10
This question already has answers here:
Unable to install pygame on Python via pip (Windows 10)
(6 answers)
Closed 2 years ago.
I'm trying to install the pygame library of python, to do it I use pip install pygame in the CMD of Windows, but then I get this error.
Collecting pygame
Using cached pygame-1.9.6.tar.gz (3.2 MB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\marcg\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\marcg\\AppData\\Local\\Temp\\pip-install-c1fzrnpr\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\marcg\\AppData\\Local\\Temp\\pip-install-c1fzrnpr\\pygame\\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\marcg\AppData\Local\Temp\pip-pip-egg-info-07h2j4on'
cwd: C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Can anyone help me?
You could try to install wheel before pip install wheel before installing pygame so it use already compiled package instead of trying to build it.
Python 3.8 doesn't support latest 1.9.6 pygame...
Try :
python3 -m pip install pygame==2.0.0.dev6
UPDATE: Windows users please use python instead of python3 and pip instead of pip3
Try pip3 uninstall pygame
and then python3 -m pip install -U pygame==2.0.0 --user
To see if it works, run one of the included examples:
python3 -m pygame.examples.aliens
If you get 'PermissionError: [WinError 5] Access is denied', before starting the command prompt right click and "Run as administrator".
If pip3 is not there, use pip
Make sure pip is updated.
Watch this video
https://www.youtube.com/watch?v=ABe_qpzQu0Q to learn about updating pip
Make sure to Read pygame official docs about windows installation
I've installed byobu on my mac os x mojave. 10.14.xx,
however when I run byobu-config the prompt returns the message
ERROR:Could not import the python snack module
I've tried pip3 install snack with no effect.
it gives me the
pip3 install snack
Collecting snack
Using cached snack-0.0.3.tar.gz (155 kB)
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wj/hcvrw53j2rlb_htp5ppq84t80000gn/T/pip-install-u4a4xlgu/snack/setup.py'"'"'; __file__='"'"'/private/var/folders/wj/hcvrw53j2rlb_htp5ppq84t80000gn/T/pip-install-u4a4xlgu/snack/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 /private/var/folders/wj/hcvrw53j2rlb_htp5ppq84t80000gn/T/pip-install-u4a4xlgu/snack/pip-egg-info
cwd: /private/var/folders/wj/hcvrw53j2rlb_htp5ppq84t80000gn/T/pip-install-u4a4xlgu/snack/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/wj/hcvrw53j2rlb_htp5ppq84t80000gn/T/pip-install-u4a4xlgu/snack/setup.py", line 47
print GCC_VERSION
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(GCC_VERSION)?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The correct solution is to install newt, not snack which is a scientific visualization library. The "snack" dependency of newt refers to snack.py file in newt library, not to be confused with the snack library (which is a scientific visualisation library). snack.py offers windowing abilities for byobu-config.
To install using conda, https://anaconda.org/conda-forge/newt
conda install -c conda-forge newt
This worked for me:
sudo zypper in python3-newt
If you're on another distro, try installing python3-newt using your package manager and it should fix the problem.
Old one, I know, but this particular
error is because you were trying to install a Python 2 module with Python 3's Pip. A tell-tale sign is the error being about print statement which is a function in Python 3.
About the error code
According to the Python documentation:
This module makes available standard errno system symbols. The value of each symbol is the corresponding integer value. The names and descriptions are borrowed from linux/include/errno.h, which should be pretty all-inclusive.
Error code 1 is defined in errno.h and means Operation not permitted.
About your error
Your setuptools do not appear to be installed. Just follow the Installation Instructions from the PyPI website.
If it's already installed, try
pip install --upgrade setuptools
If it's already up to date, check that the module ez_setup is not missing. If it is, then
pip install ez_setup
Then try again
pip install snack
If it's still not working, maybe pip didn't install/upgrade setup_tools properly so you might want to try
Refer to original answer:
https://stackoverflow.com/a/36025294/10798048
I tried installing pygame using
pip install pygame
I tried installing it using Python 3.8 but it outputs the error below.
I also tried installing using Python 3.7 but still no luck.
The error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\asus\appdata\local\programs\python\python38-32\python.exe'
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Asus\\AppData\\Local\\Temp\\pip-install-_ptqagog\\pygame\\setup.py'"'"';
__file__='"'"'C:\\Users\\Asus\\AppData\\Local\\Temp\\pip-install-_ptqagog\\pygame\\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\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\pip-egg-info'
cwd: C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x86"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Use this (I was facing the same issue and it helped me out):
pip install pygame --pre
You can try to install from the Wheel file.
After verifying that you're using python 3.7
python --version # Python 3.7.X
pip install pygame-1.9.6-cp37-cp37m-win_amd64.whl
What kind of OS system are you using? I have no problem to install on python 3.7
(base) $ python3 -m pip install -U pygame --user
Collecting pygame
Downloading https://files.pythonhosted.org/packages/32/37/453bbb62f90feff2a2b75fc739b674319f5f6a8789d5d21c6d2d7d42face/pygame-1.9.6-cp37-cp37m-macosx_10_11_intel.whl (4.9MB)
|████████████████████████████████| 4.9MB 2.7MB/s
Installing collected packages: pygame
Successfully installed pygame-1.9.6
(base) $ python -m pygame.examples.aliens
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
If the problem persists, you should use conda or another environment manager to create new environment and then install the library.
I'm not getting an error when I do this. Have you tried:
pip install pygame
Have you attempted installing with command-prompt or terminal? When I run what you are doing, I don't seem to get a problem.
Additionally, pygame is not compatible with 3.8 yet as it is unstable. Maybe wait a few months until modules are ready to be used with 3.8. Hope this helps, good day.