How to make Jupyter notebook use PYTHONPATH in system variables without hacking sys.path directly?
Jupyter uses its own JUPYTER_PATH environment variable.
Cannot import a module which is in jupyter path
I cannot reproduce your issue without additional details but I would like to provide you with some work-around that should let you load your modules in /Users/me/myModules
without changing the directory in Jupyter:
import os
from importlib.util import spec_from_file_location, module_from_spec
path = 'full/path/to/Users/me/myModules'
for fn in os.listdir(path):
fp = os.path.join(path, fn)
spec = spec_from_file_location(fn, fp)
mod = module_from_spec(spec)
spec.loader.exec_module(mod)
After running this piece of code, your modules will be already imported and free to use.
Related Topics
How Does the Code Prints 1 2 6 24 as Output and Not 24 6 2 1
How to Remove Commas and Dots of Individual Word in Two Dimensional List
How to Expand Input Buffer Size of Pyserial
How to Get String Objects Instead of Unicode from Json
Executing Multiple Functions Simultaneously
How to Pivot on Multiple Columns in Spark SQL
Replace Only Exactly Matching String Python Ndarry
Read Merged Cells in Excel With Python
Flask Installed, But Modulenotfounderror: No Module Named 'Flask'
Stuck With Loops in Python - Only Returning First Value
Visual Studio Code Intellisense Is Very Slow - Is There Anything I Can Do
Auto Reloading Python Flask App Upon Code Changes
Heroku: No Default Language Could Be Detected for This App
How to Get a Random Value from Dictionary
Why Does It Say That Module Pygame Has No Init Member
Django: Get Current User in Model Save
Python Ssl.Sslerror: [Ssl: Certificate_Verify_Failed] Certificate Verify Failed (_Ssl.C:748)