I’m using a virtualenv. (mentioned in case it matters)
My goal is to import TT.TruthTable into tests.
My hunch was to use from lab import TT as that statement mirrors one in a similar project/setup i’m working on. Could there be something else amiss.
lab03/
lab/
TT.py
__init__.py
test/
tests.py
__init__.py
>>> cat TT.py
class TruthTable...
Then
lab03/(absolute path) should be added to your PYTHONPATH. Simply using a virtualenv isnt enough because it only sets up its own lib/python.x/site-packages in the path.You can either modify your environment via:
export PYTHONPATH=$PYTHONPATH:/path/to/lab03Or, you can add it in code: