ImportError: No module named 'screen'
Hello,
I'm trying to run simple_tracker_experiment.py but I keep getting the error below.
I installed pygaze to a virtual environment called "pygaze" and I'm running the experiment from the environment. Its set to python3.5. I have an EyeLink 1000 Plus eyetracker.
----------------------------------------------------
Traceback (most recent call last):
File "simple_tracker_experiment.py", line 7, in <module>
from pygaze import libscreen
File "/anaconda3/envs/pygaze/lib/python3.5/site-packages/pygaze/libscreen.py", line 22, in <module>
from screen import Screen
ImportError: No module named 'screen'
----------------------------------------------------
Comments
Hi,
This is related to your running the script on Python 3, which handles local imports differently than Python 2 (see here: https://stackoverflow.com/questions/12172791/changes-in-import-statement-python3 )
We're currently working on transferring to Python 3, but it's slow going. It should be done before the end of 2019, but I can't offer you a more precise time.
Cheers,
Edwin
You need a file named __init__.py (two underscores on each side) in every folder in the hierarchy. This is what python looks for to know that it should access a particular folder. The files are meant to contain initialization instructions but even if you create them empty this will solve it. To get rid of this error “ImportError: No module named”, you just need to create __init__.py in the appropriate directory and everything will work fine.