This question already has answers here:
Python3.4 can't install mysql-python
(4 answers)
Closed 5 years ago.
]mitwas-MacBook-Air:mytestsite Mitwa$ pip3 install MYSQL-python
Collecting MYSQL-python
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/9l/9zjr811503367lfnybnyqlqc0000gn/T/pip-build-fk08ytxi/MYSQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/private/var/folders/9l/9zjr811503367lfnybnyqlqc0000gn/T/pip-build-fk08ytxi/MYSQL-python/setup_posix.py", line 2, in
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/9l/9zjr811503367lfnybnyqlqc0000gn/T/pip-build-fk08ytxi/MYSQL-python/
I am getting this error while setting up Django MYSQL for python. Anyone have idea how to solve it?
MYSQL-python is not compatible with Python 3. Install mysqlclient instead.
pip3 install mysqlclient
Related
I want to use mysql in django so, trying to download mysqlclent using $ pip3 install mysqlclient but always this error comes up
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/hb/vmtpfjk12fdcm_8l95hfqzmr0000gn/T/pip-build-pm_wn_w8/mysqlclient/
here are my terminal logs
$ pip3 install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-1.3.9.tar.gz
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/hb/vmtpfjk12fdcm_8l95hfqzmr0000gn/T/pip-build-pm_wn_w8/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/private/var/folders/hb/vmtpfjk12fdcm_8l95hfqzmr0000gn/T/pip-build-pm_wn_w8/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/private/var/folders/hb/vmtpfjk12fdcm_8l95hfqzmr0000gn/T/pip-build-pm_wn_w8/mysqlclient/setup_posix.py", line 26, 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/hb/vmtpfjk12fdcm_8l95hfqzmr0000gn/T/pip-build-pm_wn_w8/mysqlclient/
Please help
$ pip3 install mysqlclient
indicates that you are intending to use Python3 install the package. Based on the errors in the description, I believe that MySQL maybe missing from your machine. According to mysqlclient repo, MySQLConnectorC is one of the prerequisite to run mysqlclient on OSX.
brew install mysql-connector-c
should solve your issue.
Try adding MySQL to your PATH :
export PATH=${PATH}:/usr/local/mysql/bin/
I am trying to install fandjango by using:
pip install fandjango
However I get the error:
Collecting fandjango
Using cached fandjango-4.2.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Apaar\AppData\Local\Temp\pip-build-0j7g1eqn\fandjango\setup.py", line 5, in <module>
execfile('fandjango/version.py')
NameError: name 'execfile' is not defined
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Apaar\AppData\Local\Temp\pip-build-0j7g1eqn\fandjango\
Any help would be greatly appreciated
Fandjango only supports Python2 according to its Pypi entry, and you are using Python3 (Python3 does not have the execfile builtin function).
I'm on Ubuntu 14.04 and have both python 2.7 and 3.4 installed in my system. I was trying to install python's unirest using pip. But it returns the following error.
>> [sudo] pip install unirest
Collecting unirest
Using cached Unirest-1.1.7.tar.gz
Collecting poster>=0.8.1 (from unirest)
Using cached poster-0.8.1.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-7ur_3q0v/poster/setup.py", line 2, in <module>
import poster
File "/tmp/pip-build-7ur_3q0v/poster/poster/__init__.py", line 29, in <module>
import poster.streaminghttp
File "/tmp/pip-build-7ur_3q0v/poster/poster/streaminghttp.py", line 61
print "send:", repr(value)
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-7ur_3q0v/poster/
>>
I also tried the solution here "pip fails to install anything, error: invalid command 'egg_info'", but it did not work.
Please help
Hello Stackoverflow users,
For my student project i need to use python and mysql, but when i try to use i've this kind of error
Traceback (most recent call last):
File "myRFIDserv.py", line 2, in
import MySQLdb
ImportError: No module named MySQLdb
I 've try to fix this with the installation of python-mysqldb but they have also a error ...
Package python-mysqldb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-mysqldb' has no installation candidate
MySQL-server are already install !
I've try sudo pip install MySQL-python but i have this kind of error
Collecting MySQL-python
Using cached 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 20, in <module>
File "/tmp/pip-build-lbb0Fd/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-build-lbb0Fd/MySQL-python
I don't understand, someone can help me ? ;)
maybe you can try
pip install MySQL-python
# pip3.4 install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
Running setup.py (path:/tmp/pip_build_root/mysql-python/setup.py) egg_info for package mysql-python
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip_build_root/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip_build_root/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/mysql-python
Storing debug log for failure in /root/.pip/pip.log
MySQL-python 1.2.5 does not support Python 3. The Django 1.7 docs recommend the fork mysqlclient.
Resolved:
pip3.4 install --allow-external mysql-connector-python
Edit settings.py
'ENGINE': 'mysql.connector.django',
Under Centos: yum install mysql-devel
pip3 install mysqlclient
On Ubuntu or Debian, just sudo apt-get install python-mysqldb. It worked for me