Why does Jupyter Notebook searches files in folders, but PyCharm and Sublime Text does not?

C W tmrsg11 at gmail.com
Thu Dec 14 21:37:48 EST 2017


Hi all,

I am confused why Jupyter Notebook searches files in subfolder, but PyCharm
and Sublime Text 3 does not. Is there a rule?

For example,
I have a module or file called lr_utils.py in the current folder.

If I run the following line in Jupyter, it's fine.
> import lr_utils

But in PyCharm, I get the error,
ModuleNotFoundError: No module named 'lr_utils'

If I run it in Sublime Text, it's find too
> import os
> os.chdir("Users/My_name/Desktop/Python_Codes")
> import lr_utils

Why the code works in one but not the other? Thank you!



More information about the Python-list mailing list