I cannot seem to understand why I am getting this issue whenever I am running the command pip install MySQL-python in Ubuntu. This is what I am getting.
pip install MySQL-python
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.
Collecting MySQL-python
Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-dggKCf/MySQL-python/setup.py", line 17, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-dggKCf/MySQL-python/
Your version of python is close to the end, so you are invited to upgrade your python's version.
Mysql-python needs this old version of python and become deprecated.
Related
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.
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/2b/1sy6xpk55qz87d1dx31qn92w0000gn/T/pip-install-ke4S5K/mysqlclient/setup.py", line 16, in <module>
metadata, options = get_config()
File "setup_posix.py", line 51, in get_config
libs = mysql_config("libs")
File "setup_posix.py", line 29, in mysql_config
raise EnvironmentError("%s not found" % (_mysql_config_path,))
EnvironmentError: mysql_config not found
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/2b/1sy6xpk55qz87d1dx31qn92w0000gn/T/pip-install-ke4S5K/mysqlclient/
Try brew install mysql-connector-c. If you don't have brew installed, install it with ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Also, you should switch development from Legacy Python, i.e. Python 2, to Python 3, since it will not be supported past January 1st, 2020.
Everytime I execute my python code, it gives me the above ModuleNotFound error when I execute with python3. With python, it gives me an ImportError.
I have updated setuptools using pip install --upgrade setuptools.
I have also tried multiple commands such as: pip install mysqlclient, pip install MySQL-python, pip install pymysql.
I have tried these commands with pip3 as well (Not sure if it makes a difference).
Everytime I try these commands, it gives me the following error:
Complete output from command python setup.py egg_info:
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/0y/xsr1t8rs36l0vlq3_f2q42g40000gn/T/pip-install-soxlcjei/mysqlclient/setup.py", line 16, in <module>
metadata, options = get_config()
File "/private/var/folders/0y/xsr1t8rs36l0vlq3_f2q42g40000gn/T/pip-install-soxlcjei/mysqlclient/setup_posix.py", line 51, in get_config
libs = mysql_config("libs")
File "/private/var/folders/0y/xsr1t8rs36l0vlq3_f2q42g40000gn/T/pip-install-soxlcjei/mysqlclient/setup_posix.py", line 29, in mysql_config
raise EnvironmentError("%s not found" % (_mysql_config_path,))
OSError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/0y/xsr1t8rs36l0vlq3_f2q42g40000gn/T/pip-install-soxlcjei/mysqlclient
How do I fix this? I am using a macOS High Sierra. I have gone through solutions for similar problems on ubuntu/debian systems and have to tried to apply it here. None of that works on a mac. Also, i already have mysql installed and it works perfectly. It is constantly running on my system.
you should download a tar named as Mysql-python-1.2.4b4.tar.gz, and unzip it, cd to the dir and update the file site.cfg: # mysql_config = /usr/local/mysql/bin/mysql_config to mysql_config = /usr/local/mysql/bin/mysql_config
and then python setup.py install, after you installed the mysql-python,then you can not get the error.
I'm working on a Twilio texting program I can't install foundations I keep getting this issue. I've already tried reinstalling pip, easy_setup, pip wheel, django, and python.
I have no idea why i'm still getting this error. I'm running Mac Osx
Collecting Foundations==2.1.0 (from -r requirements.txt (line 14))
Using cached https://files.pythonhosted.org/packages/d4/c4/341b76267c3969b46170f715524259c1c170992253cb7c425d746cb2e322/Foundations-2.1.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/l5/k0m1stsn5yz8x0sx_wj4z9qm0000gn/T/pip-install-xi0ft4n3/Foundations/setup.py", line 35, in <module>
_setEncoding()
File "/private/var/folders/l5/k0m1stsn5yz8x0sx_wj4z9qm0000gn/T/pip-install-xi0ft4n3/Foundations/setup.py", line 31, in _setEncoding
reload(sys)
NameError: name 'reload' is not defined
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/l5/k0m1stsn5yz8x0sx_wj4z9qm0000gn/T/pip-install-xi0ft4n3/Foundations/
Foundations is only for Python 2.7.
I am unable to install couchdbkit in ubuntu. The command: pip3 install couchdbkit gives this following error:
Collecting couchdbkit
Using cached couchdbkit-0.6.5.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-_302m_0e/couchdbkit/setup.py", line 25, in <module>
long_description = file(
NameError: name 'file' is not defined
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_302m_0e/couchdbkit/
Please guide me if there any other way to install couchdbkit in ubuntu.
That is because couchdbkit is not supported in python3. file was removed in versions 3x from python. This is also indicated here:
Couchdbkit requires Python 2.x superior to 2.6.
Why pip3 still tries to download it is another issue.
I have a EC2 instance created on AWS and use PuTTY to connect to it.
I'm unable to install MySQL-python using python pip command as follows:
pip install MySQL-python(via root privileges)
Here is the console output of the error
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-JGbAEI/MySQL-python/setup.py", line 17, in <module>
metadata, options = get_config()
File "/tmp/pip-build-JGbAEI/MySQL-python/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-build-JGbAEI/MySQL-python/setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-JGbAEI/MySQL-python
However I'm able to install other packages using pip
Please Guide.
mysql_config is available after installation of the following package on Amazon Linux:
sudo yum install -y mysql-devel
It looks like mysql_config is missing, so make sure mysql_config is really installed.
For example on Debian/Ubuntu you must install the package:
sudo apt-get install libmysqlclient-dev