I'm working with a Jupyter notebook. I'm trying to import a file called main.py which contains 2 lines:
import os
ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) # This is your Project Root
My code:
import os
import main.py
I'm getting the error in the screenshot. I'm using a conda virtualenv which I've activated as you can see in the screenshot. You can see in the screenshot that when I run the system path
import sys
sys.path
['',
'E:\\miniconda2\\envs\\jupyter1\\python36.zip',
'E:\\miniconda2\\envs\\jupyter1\\DLLs',
'E:\\miniconda2\\envs\\jupyter1\\lib',
'E:\\miniconda2\\envs\\jupyter1',
'E:\\miniconda2\\envs\\jupyter1\\lib\\site-packages',
'E:\\miniconda2\\envs\\jupyter1\\lib\\site-packages\\IPython\\extensions',
is the path of the virtualenv python interpreter rather than my local directory. How can I fix this?