mysql-python

pip install mysql-python fails with EnvironmentError: mysql_config not found

扶醉桌前 提交于 2019-11-26 01:29:15
问题 This is the error I get (mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python Downloading/unpacking mysql-python Downloading MySQL-python-1.2.3.tar.gz (70Kb): 70Kb downloaded Running setup.py egg_info for package mysql-python sh: mysql_config: not found Traceback (most recent call last): File \"<string>\", line 14, in <module> File \"/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py\", line 15, in <module> metadata, options = get_config() File \"setup_posix.py\"

Database does not update automatically with MySQL and Python

纵饮孤独 提交于 2019-11-26 01:00:27
问题 I\'m having some trouble updating a row in a MySQL database. Here is the code I\'m trying to run: import MySQLdb conn=MySQLdb.connect(host=\"localhost\", user=\"root\", passwd=\"pass\", db=\"dbname\") cursor=conn.cursor() cursor.execute(\"UPDATE compinfo SET Co_num=4 WHERE ID=100\") cursor.execute(\"SELECT Co_num FROM compinfo WHERE ID=100\") results = cursor.fetchall() for row in results: print row[0] print \"Number of rows updated: %d\" % cursor.rowcount cursor.close() conn.close() The

“Cannot open include file: &#39;config-win.h&#39;: No such file or directory” while installing mysql-python

人走茶凉 提交于 2019-11-26 00:54:19
问题 I\'m trying to install mysql-python in a virtualenv using pip on windows. At first, I was getting the same error reported here, but the answer there worked for me too. Now I\'m getting this following error: _mysql.c(34) : Fatal error C1083: Cannot open include file: \'config-win.h\': No such file or directory If I symlink (Win7) to my regular (not the virtualenv\'s) python\'s site-packages/MySQLdb dir I get Error loading MySQLdb module: No module named _mysql I\'m rather at a loss here. Any

mysql_config not found when installing mysqldb python interface

我与影子孤独终老i 提交于 2019-11-26 00:23:10
问题 I am trying to get a Python script to run on the linux server I\'m connected to via ssh. The script uses mysqldb. I have all the other components I need, but when I try to install mySQLdb via setuptools like so:, python setup.py install I get the following error report related to the mysql_config command. sh: mysql_config: command not found Traceback (most recent call last): File \"setup.py\", line 15, in <module> metadata, options = get_config() File \"/usr/lib/python2.5/MySQL-python-1.2.3

Installing specific package versions with pip

ε祈祈猫儿з 提交于 2019-11-25 23:51:33
问题 I\'m trying to install version 1.2.2 of the MySQL_python adaptor, using a fresh virtualenv created with the --no-site-packages option. The current version shown in PyPi is 1.2.3. Is there a way to install the older version? I found an article stating that this should do it: pip install MySQL_python==1.2.2 When installed, however, it still shows MySQL_python-1.2.3-py2.6.egg-info in the site packages. Is this a problem specific to this package, or am I doing something wrong? 回答1: First, I see

Visibility of global variables in imported modules

最后都变了- 提交于 2019-11-25 23:48:59
问题 I\'ve run into a bit of a wall importing modules in a Python script. I\'ll do my best to describe the error, why I run into it, and why I\'m tying this particular approach to solve my problem (which I will describe in a second): Let\'s suppose I have a module in which I\'ve defined some utility functions/classes, which refer to entities defined in the namespace into which this auxiliary module will be imported (let \"a\" be such an entity): module1: def f(): print a And then I have the main

Database does not update automatically with MySQL and Python

末鹿安然 提交于 2019-11-25 22:27:47
I'm having some trouble updating a row in a MySQL database. Here is the code I'm trying to run: import MySQLdb conn=MySQLdb.connect(host="localhost", user="root", passwd="pass", db="dbname") cursor=conn.cursor() cursor.execute("UPDATE compinfo SET Co_num=4 WHERE ID=100") cursor.execute("SELECT Co_num FROM compinfo WHERE ID=100") results = cursor.fetchall() for row in results: print row[0] print "Number of rows updated: %d" % cursor.rowcount cursor.close() conn.close() The output I get when I run this program is: 4 Number of rows updated: 1 It seems like it's working but if I query the database

“Cannot open include file: &#39;config-win.h&#39;: No such file or directory” while installing mysql-python

旧城冷巷雨未停 提交于 2019-11-25 19:09:45
I'm trying to install mysql-python in a virtualenv using pip on windows. At first, I was getting the same error reported here , but the answer there worked for me too. Now I'm getting this following error: _mysql.c(34) : Fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory If I symlink (Win7) to my regular (not the virtualenv's) python's site-packages/MySQLdb dir I get Error loading MySQLdb module: No module named _mysql I'm rather at a loss here. Any pointers? Update for mysql 5.5 and config-win.h not visible issue In 5.5 config-win. has actually moved to