error: no module (own written python script)

I have written a module (a file `my_mod.py` file residing in the folder `my_module`).
Currently, I am working in the file `cool_script.py` that resides in the folder `cur_proj`. I have opened the folder in PyCharm using File – open (and I assume, hence, it is a PyCharm project?).

In the ProjectView (CMD-7) I can see my project `cur_proj` (in red) and under "External Libraries" I do see `my_module`. In cool_script.py, I can write
    `from my_module import my_mod as mm`
and PyCharm even makes suggestion for my_mod. So far so good.

However, when I try to run cool_script.py, PyCharm tells me
    `No module named my_module`

This seems strange to me, because
a) in the terminal (OS 10.10.2), in python, I can import the module no problem – there is a corresponding entry in the PYTHONPATH in .bashrc
b) in PyCharm – Settings – Project cur_proj – Project Interpreter – CogWheel next to python interpreter – more – show paths for selected interpreter icon, the paths from PYTHONPATH do appear (as I think they should

Hence, why do I get the error when I try to run cool_script.py?  – What am I missing?

Please sign in to leave a comment.