my version of Python is 2.2.1, as follows:
root@cristal:/usr/local/MySQL-python-1.2.0# python
Python 2.2.1 (#1, Apr 11 2002, 15:27:15) [GCC 2.95.3 20010315 (release)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
after i removed the download_url line from setup.py and began to install, there were errors again.
root@cristal:/usr/local/MySQL-python-1.2.0# export mysqlclient="mysqlclient_r"
root@cristal:/usr/local/MySQL-python-1.2.0# python setup.py build
error in setup script: invalid distribution option 'classifiers'
O,my god! error again, anyway, i removed the classifiers line, and installed:
root@cristal:/usr/local/MySQL-python-1.2.0# python setup.py build
running build
running build_py
creating build
creating build/lib.linux-i686-2.2
copying _mysql_exceptions.py -> build/lib.linux-i686-2.2
creating build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/init.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/sets.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/stringtimes.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/mxdatetimes.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/pytimes.py -> build/lib.linux-i686-2.2/MySQLdb
creating build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-i686-2.2/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-i686-2.2
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.2 -c _mysql.c -o build/temp.linux-i686-2.2/_mysql.o -I'/usr/include/mysql'
_mysql.c:41: mysql.h: No such file or directory
_mysql.c:42: mysqld_error.h: No such file or directory
_mysql.c:43: errmsg.h: No such file or directory
error: command 'gcc' failed with exit status 1
ok, it run, but with errors. i am sure there are files mysql.h, mysqld_error.h, errmsg.h in /usr/include/mysql
why did it fail?
maybe it is boring. as a green hand, i hope i can get solutions from you, adustman :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think you might need to read README. It appears you are missing some essential development packages for MySQL. My psychic powers are in remission today, so I can't tell what distribution you are using.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
today, I upgraded my Python from version 2.2.1 to 2.4.1. But still it said it could not find files mysql.h, mysqld_error.h, errmsg.h
the message it gave is:
...
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.2 -c _mysql.c -o build/temp.linux-i686-2.2/_mysql.o -I'/usr/include/mysql'
_mysql.c:41: mysql.h: No such file or directory
_mysql.c:42: mysqld_error.h: No such file or directory
_mysql.c:43: errmsg.h: No such file or directory
error: command 'gcc' failed with exit status 1
i am sure those files are in /usr/include/mysql
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Even though you upgraded, your last attempt was still with Python-2.2. But that isn't really the issue. Post the output of the mysql_config command, and note what operating system you are using; I don't remember if you posted it earlier.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
there are two mysql_config commands in my system.
root@cristal:~# find / -name mysql_config
/usr/local/mysql-standard-4.1.4-gamma-pc-linux-i686/bin/mysql_config
/usr/bin/mysql_config
root@cristal:/usr/bin# ./mysql_config
Usage: ./mysql_config [OPTIONS]
Options:
--cflags [-I'/usr/include/mysql']
--libs [-L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm]
--socket [/var/run/mysql/mysql.sock]
--port [3306]
--version [3.23.51]
I think this is the initial one when I installed the os.
I think the sensible thing would be to uninstall your Slackware-provided mysql, since you probably don't intend to use it. Until then, do this before running setup.py:
What version of Python are you using? I'm guessing you have an old version of distutils. You need to have at least Python-2.2 for MySQLdb-1.2 to run. As a workaround, simply remove the download_url line; it's not needed for end-users to install. Also, it is no longer necessary to set mysqlversion.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i am a green hand
i follow the instructions but failed
root@cristal:/usr/local/MySQL-python-1.2.0# export mysqlclient="mysqlclient_r"
root@cristal:/usr/local/MySQL-python-1.2.0# export mysqlversion="4.1.4"
root@cristal:/usr/local/MySQL-python-1.2.0# python setup.py build
error in setup script: invalid distribution option 'download_url'
in setup.py:
...
metadata = {
'name': name,
'version': version,
'description': "Python interface to MySQL",
'long_description': doc,
'author': "Andy Dustman",
'author_email': "andy@dustman.net",
'license': "GPL",
'platforms': "ALL",
'url': "http://sourceforge.net/projects/mysql-python",
'download_url': "http://prdownloads.sourceforge.net/mysql-python/" \ "MySQL-python-%s.tar.gz" % version,
'classifiers': [ c for c in classifiers.split('\n') if c ],
...
who can tell me reason?
thanks a lot!
my version of Python is 2.2.1, as follows:
root@cristal:/usr/local/MySQL-python-1.2.0# python
Python 2.2.1 (#1, Apr 11 2002, 15:27:15)
[GCC 2.95.3 20010315 (release)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
after i removed the download_url line from setup.py and began to install, there were errors again.
root@cristal:/usr/local/MySQL-python-1.2.0# export mysqlclient="mysqlclient_r"
root@cristal:/usr/local/MySQL-python-1.2.0# python setup.py build
error in setup script: invalid distribution option 'classifiers'
O,my god! error again, anyway, i removed the classifiers line, and installed:
root@cristal:/usr/local/MySQL-python-1.2.0# python setup.py build
running build
running build_py
creating build
creating build/lib.linux-i686-2.2
copying _mysql_exceptions.py -> build/lib.linux-i686-2.2
creating build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/init.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/sets.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/stringtimes.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/mxdatetimes.py -> build/lib.linux-i686-2.2/MySQLdb
copying MySQLdb/pytimes.py -> build/lib.linux-i686-2.2/MySQLdb
creating build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-i686-2.2/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-i686-2.2/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-i686-2.2
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.2 -c _mysql.c -o build/temp.linux-i686-2.2/_mysql.o -I'/usr/include/mysql'
_mysql.c:41: mysql.h: No such file or directory
_mysql.c:42: mysqld_error.h: No such file or directory
_mysql.c:43: errmsg.h: No such file or directory
error: command 'gcc' failed with exit status 1
ok, it run, but with errors. i am sure there are files mysql.h, mysqld_error.h, errmsg.h in /usr/include/mysql
why did it fail?
maybe it is boring. as a green hand, i hope i can get solutions from you, adustman :)
I think you might need to read README. It appears you are missing some essential development packages for MySQL. My psychic powers are in remission today, so I can't tell what distribution you are using.
today, I upgraded my Python from version 2.2.1 to 2.4.1. But still it said it could not find files mysql.h, mysqld_error.h, errmsg.h
the message it gave is:
...
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.2 -c _mysql.c -o build/temp.linux-i686-2.2/_mysql.o -I'/usr/include/mysql'
_mysql.c:41: mysql.h: No such file or directory
_mysql.c:42: mysqld_error.h: No such file or directory
_mysql.c:43: errmsg.h: No such file or directory
error: command 'gcc' failed with exit status 1
i am sure those files are in /usr/include/mysql
Even though you upgraded, your last attempt was still with Python-2.2. But that isn't really the issue. Post the output of the mysql_config command, and note what operating system you are using; I don't remember if you posted it earlier.
there are two mysql_config commands in my system.
root@cristal:~# find / -name mysql_config
/usr/local/mysql-standard-4.1.4-gamma-pc-linux-i686/bin/mysql_config
/usr/bin/mysql_config
root@cristal:/usr/bin# ./mysql_config
Usage: ./mysql_config [OPTIONS]
Options:
--cflags [-I'/usr/include/mysql']
--libs [-L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm]
--socket [/var/run/mysql/mysql.sock]
--port [3306]
--version [3.23.51]
I think this is the initial one when I installed the os.
root@cristal:/usr/local/mysql-standard-4.1.4-gamma-pc-linux-i686/bin# ./mysql_config
Usage: ./mysql_config [OPTIONS]
Options:
--cflags [-I/usr/local/mysql-standard-4.1.4-gamma-pc-linux-i686/include -mcpu=pentiumpro]
--include [-I/usr/local/mysql-standard-4.1.4-gamma-pc-linux-i686/include]
--libs [-L/usr/local/mysql-standard-4.1.4-gamma-pc-linux-i686/lib -lmysqlclient -lcrypt -lnsl -lm -lz -lc -lnss_files -lnss_dns -lresolv -lc -lnss_files -lnss_dns -lresolv]
--libs_r [-L/usr/local/mysql-standard-4.1.4-gamma-pc-linux-i686/lib -lmysqlclient_r -lpthread -lcrypt -lnsl -lm -lpthread -lc -lnss_files -lnss_dns -lresolv -lc -lnss_files -lnss_dns -lresolv]
--socket [/tmp/mysql.sock]
--port [3306]
--version [4.1.4-gamma]
--libmysqld-libs [-L/usr/local/mysql-standard-4.1.4-gamma-pc-linux-i686/lib -lmysqld -lpthread -lcrypt -lnsl -lm -lpthread -lc -lnss_files -lnss_dns -lresolv -lc -lnss_files -lnss_dns -lresolv -lrt]
I think this is corresponding to the mysql that I installed after I had installed the os.
my os is SlackWare8.1
I think the sensible thing would be to uninstall your Slackware-provided mysql, since you probably don't intend to use it. Until then, do this before running setup.py:
export PATH="/usr/local/mysql-standard-4.1.4-gamma-pc-linux-i686/bin:$PATH"
I think this will solve your build problems.
according to suggesions, it seems that the problem is solved, thanks a lot, adustman :)
What version of Python are you using? I'm guessing you have an old version of distutils. You need to have at least Python-2.2 for MySQLdb-1.2 to run. As a workaround, simply remove the download_url line; it's not needed for end-users to install. Also, it is no longer necessary to set mysqlversion.