I have an input error in pycharm when debugging and running.
My project structure is rooted properly, etc./HW3/.
so that HW3
is the root di
In Pycharm go to "Run - Configuration" and uncheck 'Add Content root to Pythonpath' and 'Add source roots to Pythonpath', then use
from filename import functionname
Note: May be a bit unrelated.
I was facing the same issue but I was unable to import a module in the same directory (rather than subdirectory as asked by OP) when running a jupyter notebook (here the directory didn't have __init__.py). Strangely, I had setup python path and interpreter location and everything. None of the other answers helped but changing the directory in python did.
import os
os.chdir(/path/to/your/directory/)
I'm using PyCharm 2017.3
on Ubuntu 16.04