I have a python file which contains classes and functions and a
if __name__ == "__main__":
...
construct. I want to test a class which is defined in this file with py.test. For my first "hello world"-test, my test-file only imports the file to be tested.
Running py.test in PyCharm results however in
raceback (most recent call last):
File "[...]/unittest/datageneration_test.py", line 1, in <module>
from main.datageneration import *
File "[...]/main/datageneration.py", line 1, in <module>
import pandas as pd
File "[...]/lib/python3.6/site-packages/pandas/__init__.py", line 19, in <module>
"Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']
My file to be tested has the import statements
import pandas as pd
import numpy as np
from scipy.special import expit
import sys
import os
import scipy.io.wavfile as wav
import json
import uuid
My conda environment.yml is
channels:
- conda-forge
- defaults
dependencies:
- pandas=0.20.3
- numpy=1.13.1
- ggplot=0.11.5
- python=3.6.2
- pytest=3.2.1
What is the issue here?