I have problems running py.test over packages that imports mysql. The package mysql was installed with pip in a virtualenv.
# test_mysql.py
import mysql
def foo():
pass
I can run without any problem python test_mysql.py
, but when I execute py.test test_mysql.py
I get:
> import mysql
E ImportError: No module named mysql
Any idea what's the problem?
It seems like you're using system-wide version of py.test
which use non-virtualenv-version of python. (In which, mysql
package is not installed).
Install py.test
inside the virtualenv, then your problem will be solved.
SIDE NOTE
To make sure you're using the newly-installed py.test
, clear the command path cache used by shell.
For example, if you use bash
, issue the following command:
hash -r
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