There are many similar posts I have found. However, those post did not provide solution of my problem. So that I thought to ask the question regarding my problem. My problem is in unit test and import module. My project has following hierarchy.
app/
__init__.py
src/
__init__.py
person.py
tests/
__init__.py
test_person.py
I use pytest for unit test. Inside tests/test_person.py
## tests/test_person.py
from ..src import person
Inside src/person.py
## src/person.py
from Bio import PDB
From app/, I run py.test and got the error.
from Bio import PDB
E ImportError: No module named Bio
I further tested in command line to check whether from Bio import PDB can be imported or not. It can be imported without any error.
Python 2.7.4 (default, May 14 2013, 09:41:12)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Bio import PDB
>>>
I don't know what is the error. Someone has any guess?