mysqlubuntupython
我在ubuntu14.4上面操作,python2.7,mysql5.5 ,用了virtualenv,
当我在虚拟环境外安装好mysql-connector-python_2.0.4-1ubuntu14.04_all.deb后可以正常使用,
think@think-inspiron-n4050:~/download$ sudo dpkg -i mysql-connector-python_2.0.4-1ubuntu14.04_all.deb [sudo] password for think: selecting previously unselected package mysql-connector-python.(reading databse ...)preparing to unpack mysql-connector-python_2.0.4-1ubuntu14.04_all.deb ...unpacking mysql-connector-python (2.0.4-1ubuntu14.04) ...setting mysql-connector-python (2.0.4-1ubuntu14.04) ...think@think-inspiron-n4050:~/download$ python python 2.7.6 (default, jun 22 2015, 18:00:18) [gcc 4.8.2] on linux2type help, copyright, credits or license for more information.>>> import mysql.connector>>> exit()
我需要在virtualenv环境下使用,于是我又在venv环境里安装了一个,安装正常,但是无法引入
(venv)think@think-inspiron-n4050:~/download$ dpkg -i mysql-connector-python_2.0.4-1ubuntu14.04_all.deb (venv)think@think-inspiron-n4050:~/download$ sudo dpkg -i mysql-connector-python_2.0.4-1ubuntu14.04_all.deb (reading database ... )preparing to unpack mysql-connector-python_2.0.4-1ubuntu14.04_all.deb ...unpacking mysql-connector-python (2.0.4-1ubuntu14.04) over (2.0.4-1ubuntu14.04) ...setting mysql-connector-python (2.0.4-1ubuntu14.04) ...(venv)think@think-inspiron-n4050:~/download$ python python 2.7.6 (default, jun 22 2015, 18:00:18) [gcc 4.8.2] on linux2type help, copyright, credits or license for more information.>>> import mysql.connectortraceback (most recent call last): file , line 1, in importerror: no module named mysql.connector
请各位老师指点一下,谢谢