I operate on ubuntu14.4, python2.7, mysql5.5, with virtualenv, when I installed a mysql-connector-python_2.0.4-1ubuntu14.04_all.deb outside the virtual environment can be used normally, & quot; think @ think-Inspiron-N4050 :~ Download $ sudodpkg-imysql-connector-python_2.0.4-1ubuntu14.04_all.deb [sudo] passwordfort... mysql+tupython
I operate on ubuntu14.4, python2.7, mysql5.5, using virtualenv,
When I have installed a mysql-connector-python_2.0.4-1ubuntu14.04_all.deb outside of the virtual environment,
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()
I need to use it in the virtualenv environment, so I installed another one in the venv environment. the installation is normal, but it cannot be introduced.
(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
Please give me some advice. thank you.