Issue
I use python vitrualenv and when I want to install any packages by pip install <package name>
I take that error:
ERROR: Command errored out with exit status 1:
command: /home/user/project/some_project_name/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sifdsjjx/MySQL-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sifdsjjx/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 /tmp/pip-install-sifdsjjx/MySQL-python/pip-egg-info
cwd: /tmp/pip-install-sifdsjjx/MySQL-python/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-sifdsjjx/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-install-sifdsjjx/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 use python 3.7.0 pip 20.0.2
Solution
Try to upgrade setuptools
:
pip install --upgrade setuptools
UPDATE
As mentioned in the comments, you are attempting to install MySQL-python
which is a very old package (last release was made back in 2014).
You can however install a more recent one, called MySQLdb
which is a thin python wrapper around C module which implements API for MySQL database:
pip install mysqlclient
Answered By - Giorgos Myrianthous Answer Checked By - Pedro (WPSolving Volunteer)