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)

Azat Ibrakov
  • 9,998
  • 9
  • 38
  • 50
Peter Estiven
  • 414
  • 1
  • 7
  • 16

2 Answers2

1

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.

gehbiszumeis
  • 3,525
  • 4
  • 24
  • 41
  • 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 Estiven Sep 26 '18 at 14:57
  • @Peter. I see. I edited my answer. Does this work for you and fit your boundary conditions better? – gehbiszumeis Sep 27 '18 at 06:32
0

Try to reinstall jupyter.

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

  • 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. – Peter Estiven Sep 26 '18 at 13:20
  • ok have look there: https://stackoverflow.com/a/44072803/4776701 But is this really a better solution? – knuspertante Sep 26 '18 at 14:37
  • Thanks for the link. But it doesn't help for what I'm looking for. – Peter Estiven Sep 27 '18 at 00:02