mysql-python

GCC error when installing MySQL_python 1.2.2 (Mac OS 10.6 Snow Leopard)

让人想犯罪 __ 提交于 2020-02-07 06:33:08
问题 I'm trying to install MySQL_python 1.2.2 (I specifically need this version, not the current 1.2.3) on Snow Leopard, and getting this error below. Command to install: pip install -Iv http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/MySQL-python-1.2.2.tar.gz/download And a portion of the trace: copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.6-universal-2.6/MySQLdb/constants running build_ext building '_mysql' extension creating build/temp.macosx-10.6-universal-2

GCC error when installing MySQL_python 1.2.2 (Mac OS 10.6 Snow Leopard)

本秂侑毒 提交于 2020-02-07 06:32:28
问题 I'm trying to install MySQL_python 1.2.2 (I specifically need this version, not the current 1.2.3) on Snow Leopard, and getting this error below. Command to install: pip install -Iv http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/MySQL-python-1.2.2.tar.gz/download And a portion of the trace: copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.6-universal-2.6/MySQLdb/constants running build_ext building '_mysql' extension creating build/temp.macosx-10.6-universal-2

Python: ImportError no module named mysql.connector

本小妞迷上赌 提交于 2020-01-30 08:11:07
问题 I just created an exe from python script and when I tried to run it, it did not show up. Then, I tried to run it from cmd and I got ImportError below: Traceback (most recent call last): File "tkintertest2.py", line 17, in <module> File "Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module File "MySQL.py", line 1, in <module> ImportError: No module named mysql.connector Failed to execute script tkintertest2 How to solve this? I have installed mysql.connector

ModuleNotFoundError: No module named 'MySQLdb' Amazon MySQL RDS SQLAlchemy

∥☆過路亽.° 提交于 2020-01-30 06:27:07
问题 I am having issues with connecting Amazon AWS MySQL with SQLAlchemy. According to the instruction, I have connected. app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://<user>:<password>@<host>/<dbname> But there is an error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/ec2-user/venv/lib/python3.7/site-packages/flask_sqlalchemy/__init__.py", line 514, in __get__ return type.query_class(mapper, session=self.sa.session()) File "/home/ec2-user/venv/lib/python3

MySQLdb raises “execute() first” error even though I execute before calling fetchall

血红的双手。 提交于 2020-01-30 06:24:08
问题 I'm getting the following error while trying to use MySQLdb with Flask. _mysql_exceptions.ProgrammingError: execute() first The print output shows me that "After fetch" never gets printed, meaning that the script breaks down at row = g.db.cursor().fetchall() . Why am I getting this error and how do I fix it? def connect_db(): return mysql.connection @app.before_request def before_request(): g.db = connect_db() @app.teardown_request def teardown_request(exception): g.db.cursor().close() @app

MySQLdb raises “execute() first” error even though I execute before calling fetchall

我怕爱的太早我们不能终老 提交于 2020-01-30 06:24:07
问题 I'm getting the following error while trying to use MySQLdb with Flask. _mysql_exceptions.ProgrammingError: execute() first The print output shows me that "After fetch" never gets printed, meaning that the script breaks down at row = g.db.cursor().fetchall() . Why am I getting this error and how do I fix it? def connect_db(): return mysql.connection @app.before_request def before_request(): g.db = connect_db() @app.teardown_request def teardown_request(exception): g.db.cursor().close() @app

Unable to install mysqlclient Python package on Windows

霸气de小男生 提交于 2020-01-28 10:05:48
问题 I am trying to install the mysqlclient Python package (https://pypi.python.org/pypi/mysqlclient) into a virtual Python 2.7 environment on Windows 7 (on a local PC, and on the Appveyor CI) and cannot get it done. I am describing the issues for the local PC with Win 7, but it happens basically the same way on Appveyor. Packages in my virtualenv when I start: pip (9.0.1) setuptools (36.6.0) wheel (0.30.0) pip install mysqlclient initially says: . . . running build_ext building '_mysql' extension

Unable to install mysqlclient Python package on Windows

谁说胖子不能爱 提交于 2020-01-28 10:04:04
问题 I am trying to install the mysqlclient Python package (https://pypi.python.org/pypi/mysqlclient) into a virtual Python 2.7 environment on Windows 7 (on a local PC, and on the Appveyor CI) and cannot get it done. I am describing the issues for the local PC with Win 7, but it happens basically the same way on Appveyor. Packages in my virtualenv when I start: pip (9.0.1) setuptools (36.6.0) wheel (0.30.0) pip install mysqlclient initially says: . . . running build_ext building '_mysql' extension

Python, MySQL _mysql_exceptions.ProgrammingError: (1064, 'You have an error in your SQL syntax

五迷三道 提交于 2020-01-24 21:41:08
问题 Im currently sending a twitter stream to a local MySQL db and I have run into an issue. Whenever a user creates a tweet with " located within it, I will get a syntax error because it messes with the Insert statement. Im curious of the best way to fix this so a persons tweet will not effect the insert statement. example variables: tweetId = 98757629 userId = 07gos870sg text = "this is "what " is messing up my sql" day = 04 month = 'dec' year = 2016 hour = 23 minute = 45 placeId = 'kj4h5b899' c

Can't connect to MySQL server (111) even after changing bind-address

孤人 提交于 2020-01-24 20:45:28
问题 I wrote a few lines of code that sends data to a remote MySQL database. import MySQLdb db = MySQLdb.connect("MyServerIP","MyUserName","MYPwd","MyDB") # prepare a cursor object using cursor() method cursor = db.cursor() # execute SQL query using execute() method. cursor.execute("INSERT INTO mytable(Column1) VALUES (Value1);") # Fetch a single row using fetchone() method. data = cursor.fetchone() # disconnect from server db.close() Error: Can't connect to MySQL server (111) I tried: Putting in