mercredi 18 novembre 2015

Py.test test class failing due to import error

I have a tests/ directory with a single file that imports a number of 3rd party programs (pandas, etc). I'm running within a virtual env that has pandas installed.

pip freeze | grep pandas; cat requirements.txt | grep pandas
pandas==0.16.0
pandas==0.16.0

When I execute py.test I get the following error:

tests/test_pipeline.py:4: in <module>
    import pandas as pd
E   ImportError: No module named pandas

Which is the import pandas call within the test_pipeline.py file.

cat -n  tests/test_pipeline.py  | more
     1  import sys
     2  import os
     3  import filecmp
     4  import pandas as pd

Why is this an error when virtualenv is setup correctly? What am I doing incorrectly?

TIA

Aucun commentaire:

Enregistrer un commentaire