如果我尝试使用shell,就会遇到API冲突。
/home/username/.python-eggs/MySQL_python-1.2.3c1-py2.6-linux-i686.egg-tmp/_mysql.so:6: RuntimeWarning: Python C API version mismatch for module _mysql: This Python has API version 1012, module _mysql has version 1013.
我在跑:
Python2.6
MySQL服务器版本: 5.0.77
MySQL_python-1.2.3c1
我试图
我试图安装MySQL库,以便使用Django进行开发,但总是以不同的方式显示任何错误:
与PIP:
rigo:~ rigobcastro$ sudo pip install MySQL-Python
Downloading/unpacking MySQL-Python
Could not fetch URL https://pypi.python.org/simple/MySQL-Python/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:503: error
我正试图在windows机器上安装django (我发誓,这不是我的错)。当涉及到mysqldb模块时,我总是收到这样的错误:
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\Users\ME> easy_install MySQL-python
Searching for MySQL-python
Reading http://pypi.python.org/simple/MySQL-python/
Reading http://sourceforge.ne
我正试图在centOS 7中部署一个烧瓶应用程序。
我用:sudo yum install mysql-connector-python安装了连接器
但是当我运行:python init.py时,我得到了这个错误:
from mysql import connector
ImportError: No module named mysql
注意:我的项目在虚拟环境中。
在我的虚拟世界里:
pip install MySQL-python
错误:Requirement already satisfied (use --upgrade to upgrade): MySQL-python in /r
mySQL似乎已经启动并运行得很好。但是,当我试图将MySQLdb导入python时,我会得到一个ImportError: ... Expected in: flat namespace。我认为这与python有两个不同的版本有关(两个不同的目录,同一个版本)。
操作系统: Mac 10.6.8
$ ls /Library/Frameworks/Python.framework/Versions/
7.2 Current
$ which python
/Library/Frameworks/Python.framework/Versions/Current/bin/python
$ ech
我正在运行MySQLdb v1.2.3并获得以下错误:
LookupError: unknown encoding: utf8mb4
建议将MySQLdb更新到1.2.5版本。我进行了更新,现在收到了以下错误:
ImportError: this is MySQLdb version (1, 2, 5, 'final', 1), but _mysql is version (1, 2, 3, 'final', 0)
我不知道如何更新_mysql,或者这将如何改变我的设置。这只是一个python模块,还是以某种方式连接到我的MySQL服务器?
编辑:我尝试运行以下
我编写了一个运行ok的脚本,但是当我从crontab运行它时,我会得到一个导入错误。
Traceback (most recent call last):
File "/Users/.../Desktop/test.py", line 3, in <module>
import MySQLdb as mysql
File "build/bdist.macosx-10.7-intel/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdi
我想使用mysql form plone,但我不能构建plone。
构建日志
Getting required 'MySQL-python>=1.2.1'
required by Products.ZMySQLDA 3.1.1.
We have no distributions for MySQL-python that satisfies 'MySQL-python>=1.2.1'.
Getting distribution for 'MySQL-python>=1.2.1'.
Running easy_install:
为了满足遗留Django应用程序的要求,我需要在Debian 9上的一个新的虚拟服务器上安装MySQL-python==1.2.5。
pip install MySQL-python==1.2.5
我知道这个错误:
$ pip install MySQL-python==1.2.5
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.
我想使用mysql-connectorpython 3 的库。我可以使用pymysql,但mysql-connector已经有连接池实现,但pymysql似乎没有。所以这对于我来说写的代码会更少。 但是,当我这样做 $ pip3 search mysql-connector 我发现这3个库可用: mysql-connector-repackaged - MySQL driver written in Python
mysql-connector-python-rf - MySQL driver written in Python
mysql-connector-python
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.6-intel/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 7, in <mod