1

I've installed Python and Jupyter in a folder. And then, I moved this folder. Python was in E:\Python and Jupyter in E:\Python\Scripts. Now, Python is in E:\Projects\Tests\Python and Jupyter is in E:\Projects\Tests\Python\Scripts.

When I try to start Jupyter notebook with command Line (jupyter notebook) from E:\Projects\Tests\Python\Scripts, I have the error :

Fatal error in launcher: Unable to create process using '"E:\Python\python.exe" "E:\Projects\Tests\Python\Scripts\jupyter.exe" notebook' 

Jupyter kept the old Python path.

How can I specify the new path? Is there a command line like

start "E:\Projects\Tests\Python\python.exe" "E:\Projects\Tests\Python\Scripts\jupyter.exe" notebook' 

(this doesn't work)

2 Answers 2

2

It seems that jupyter doesn't find the new directory in the %path% variable.

Do you find your new directories in the %path% variable when you type

echo %path% 

in a command window? If no, try to add it by typing in the command line

setx path "%path%;E:\Projects\Tests\Python\python.exe;E:\Projects\Tests\Python\Scripts\jupyter.exe" 

EDIT: Changing the windows %path% is not desired.

Preferred is a change of the ipython_config.py file

In that case, open a command window and type

ipython profile create 

and

ipython locate 

This will output you the path of your .ipython folder, which contains now a default ipython_config.py. Go to this line

## lines of code to run at IPython startup. #c.InteractiveShellApp.exec_lines = [] 

and replace the second line by

c.InteractiveShellApp.exec_lines = ['import sys; sys.path.append("E:\Projects\Tests\Python\"); sys.path.append("E:\Projects\Tests\Python\Scripts\")'] 

This will append your new paths TEMPORARY to the path variable every time jupyter notebook starts iPython. So every time you move your folders you would have to adjust these lines in the ipython_config.py.

Sign up to request clarification or add additional context in comments.

2 Comments

Actually, no because I don't want to change the path variable on my system. I would like to be able to move my folder without having to modify windows path. Is there a line in the Jupyter config file where it's possible to specify Python path ? It would be a nice solution.
@Peter. I see. I edited my answer. Does this work for you and fit your boundary conditions better?
0

Try to reinstall jupyter.

pip install --upgrade --no-deps --force-reinstall jupyter

3 Comments

I would like to avoid that. Because I would like to be able to move my folder when I want. That's why I try to find a way to change this python path in Jupyter or to use a command line like start "E:\Projects\Tests\Python\python.exe" "E:\Projects\Tests\Python\Scripts\jupyter.exe" notebook'. This last solution doesn't work unfortunately.
ok have look there: stackoverflow.com/a/44072803/4776701 But is this really a better solution?
Thanks for the link. But it doesn't help for what I'm looking for.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.