close

[Solved] Module Not found during import in Jupyter Notebook

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Module Not found during import in Jupyter Notebook in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Module Not found during import in Jupyter Notebook Error Occurs?

Today I get the following error Module Not found during import in Jupyter Notebook in python.

How To Solve Module Not found during import in Jupyter Notebook Error ?

  1. How To Solve Module Not found during import in Jupyter Notebook Error ?

    To Solve Module Not found during import in Jupyter Notebook Error I ran it with some dummy modules in the same structure as you had specified, and before modifying sys.path it wouldn't run and after it would

  2. Module Not found during import in Jupyter Notebook

    To Solve Module Not found during import in Jupyter Notebook Error I ran it with some dummy modules in the same structure as you had specified, and before modifying sys.path it wouldn't run and after it would

Solution 1

tl;dr the cwd of the notebook server is always the base path where you started the server, no matter was running import os os.getcwd() says. Use import sys sys.path.append("/path/to/your/module/folder").

I ran it with some dummy modules in the same structure as you had specified, and before modifying sys.path it wouldn’t run and after it would

Solution 2

two lines of code will solve this,

#list the current work dir
os.getcwd()
#change the current work dir
os.chdir()

change the path, and import module, have fun.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read