I'm using Amazon Linux AMI release 2013.09. I've install virtualenv and after activation then I run pip install mysql-connector-python, but when I run my app I get an error: ImportError: No module named mysql.connector
. Has anyone else had trouble doing this? I can install it outside of virtualenv and my script runs without issues. Thanks in advance for any help!
Several things. There is an inconsistency in package naming so you may want to do:
pip search mysql-connector
to find out what it is called on your platform. I got two results mysql-connector-python
and mysql-connector-repackaged
.
so try this first:
pip install mysql-connector-python
this may additionally give an error like this:
Some externally hosted files were ignored (use --allow-external mysql-connector-python to allow).
so finally this should do the job:
pip install mysql-connector-python --allow-external mysql-connector-python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With