Skip to content Skip to sidebar Skip to footer

Ipython Notebook (python 3): Importerror: No Module Named

First of all, I am really a python idiot, and this is my first python test. I am running a test_predictors.ipynb file using Jupyter. I ran into an 'ImportError: No module named' er

Solution 1:

Try this:

sys.path.insert(0, 'directory_of_the_pyfile_you_want_to_import')

import FOLDER.file

where FOLDER is the module name and file is the .py file you want to import.

This if the __init__.py solution don't work..

Solution 2:

Seems to me that you cannot import any script from your working directory. This shouldn't be happening. I suggest you take a look at your python paths by running in your notebook:

import sys
print sys.path

if your home directory or directory of notebooks, something like 'C:\\Users\\yourusername\\.ipython' doesn't show up then you probably need add it as a path. try adding your home directory to path:

sys.path.append('C:\\Users\\yourusername\\')

or

sys.path.insert(1, 'C:\\Users\\yourusername\\')

Post a Comment for "Ipython Notebook (python 3): Importerror: No Module Named"