I usually run python2 but I am playing with python3. Right now I am confused as to why I am getting this error.
When I run the command ./test_web_events.py in the tests directory, I get:
Traceback (most recent call last): File "./test_web_events.py", line 21, in <module> import qe.util.scratchstore as scratchstore ImportError: No module named 'qe' However my project structure has qe directory in it:
/python_lib Makefile /qe __init__.py /tests __init__.py test_web_events.py /util __init__.py scratchstore.py /trinity __init__.py I tried moving my /tests directory into /python_lib but I am still getting the same error:
MTVL1289dd026:python_lib bli1$ ls Makefile qe rundata setup.sh tests MTVL1289dd026:python_lib bli1$ python3 tests/test_web_events.py Traceback (most recent call last): File "tests/test_web_events.py", line 21, in <module> import qe.util.scratchstore as scratchstore ImportError: No module named 'qe' Here is my sys.path for python2
>>> import sys >>> print sys.path ['', '/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages'] sys.path for python3
>>> print(sys.path) ['', '/Library/Frameworks/Python.framework/Versions/3.4/lib/python34.zip', '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4', '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/plat-darwin', '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload', '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages']
python_lib__init__.pyfile (it can be empty).