You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
how to run notebook from any folder on computer #848
Please help how to run notebook from any folder on computer
the problem is Jupyter Notebook.exe from
e:\WINPYTHON_FULL_apr22\WPy64-3770\Jupyter Notebook.exe
can read only notebooks from
E:\WINPYTHON_FULL_apr22\WPy64-3770\notebooks
so lets say file my_notebook.ipynb located in
E:\my_code
Ok, so here's a simple and uncomplicated way of doing this:
-copy the path of the project folder you would like to create your notebook in. Simply click on the path in the windows explorer and copy to clipboard
-open the WinPython Command Prompt in the WinPython folder. I recommend adding the WP Command Prompt to the taskbar (usefull for pip install stuff etc.)
-type cd PASTE and hit enter. By PASTE I actually mean Ctrl+v the path you had copied in step one. Now you've changed the directory to your project's path (cd stands for change directory).
In your example this step means typing cd E:\my_code and enter.
-type jupyter notebook or jupyter lab and hit enter.
Now you've successfully opened jupyter in a directory of your choice.
-create a notebook and start coding ;)
And you should register *.ipynb files to the jupyter notebook/lab app in the winpython directory. Then you can launch the notebook you created earlier by simply klicking on the file.
As you see, it only takes 2 lines in the WP command prompt: cd E:\my_code and jupyter notebook it's really not complicated at all...
I know that is already old, but I had the same problem. The suggestion by @BerlXIII works, but stil requires you to start something somehwere else.
I threw together some pieces of the available scripts and wrote the following Batch-file called "Start-Jupyter-Here.bat":
@echooffecho This scipts starts Jupyter from any folder
echo The path to the root of WinPython has to be defined in this script
echo.
rem Path without \ at the end!setwipypfad=c:\WinPython-64bit-3.6.1.0Qt5
echo We use %wipypfad%ifnotexist%wipypfad%\scripts\env_for_icons.bat echo Path not correct! %wipypfad%\scripts\env_for_icons.bat not found! EXIT
ifnotexist%wipypfad%\scripts\env_for_icons.bat goto :EndHereecho.
echo Path is correct!
call"%wipypfad%\scripts\env_for_icons.bat"echo Calling Jupyter ....
jupyter notebook
:EndHere
It is pretty much what was suggested above, but you can copy this batch file into any folder and directly launch Jupyter by double-clicking the batch file in that folder Works on network shares as well.
I suggest another "Start_Jupyter [WPy-x64-3760ps2].cmd" to run a Jupyter Notebook-server in the directory of the script:
@ECHO OFF
SET winpydir=C:\WinPython
SET winpy=WPy-x64-3760ps2
CMD /S /C "title Jupyter Notebook Server (%winpy%) && "%winpydir%\%winpy%\scripts\ipython_notebook.bat" %~dp0"
ECHO.
ECHO Server halted.
PAUSE
EXIT /B 0
You should put the script in the root-folder of your notebooks' location and run the script via a shortcut from anywhere.
So, here the folders for the installation and notebooks are fixed, but not the same.
The working directory should be changed from within the chosen notebook.
Activity
stonebig commentedon Apr 26, 2020
did you try drag & drop the notebook on jupyterlab icon ?
stonebig commentedon Apr 26, 2020
with Winpython64-3.8.2.1codb2.exe, you can also try drag & drop the notebook on VSCode icon.
Sandy4321 commentedon Apr 26, 2020
so no way to run from command line
something like this
stonebig commentedon May 1, 2020
the icon is doing what is in scripts\winjupyter_lab.bat:
so to call E:\my_code\my_notebook.ipynb, you can do:
Sandy4321 commentedon May 1, 2020
unbelievable , so complicated...
stonebig commentedon May 1, 2020
maybe they have better ideas on stackoverflow, you may ask there
BerlXIII commentedon Jun 21, 2020
Ok, so here's a simple and uncomplicated way of doing this:
-copy the path of the project folder you would like to create your notebook in. Simply click on the path in the windows explorer and copy to clipboard
-open the WinPython Command Prompt in the WinPython folder. I recommend adding the WP Command Prompt to the taskbar (usefull for pip install stuff etc.)
-type
cd PASTEand hit enter. By PASTE I actually mean Ctrl+v the path you had copied in step one. Now you've changed the directory to your project's path (cd stands for change directory).In your example this step means typing
cd E:\my_codeand enter.-type
jupyter notebookorjupyter laband hit enter.Now you've successfully opened jupyter in a directory of your choice.
-create a notebook and start coding ;)
And you should register *.ipynb files to the jupyter notebook/lab app in the winpython directory. Then you can launch the notebook you created earlier by simply klicking on the file.
As you see, it only takes 2 lines in the WP command prompt:
cd E:\my_codeandjupyter notebookit's really not complicated at all...joeheaven commentedon Aug 15, 2020
I know that is already old, but I had the same problem. The suggestion by @BerlXIII works, but stil requires you to start something somehwere else.
I threw together some pieces of the available scripts and wrote the following Batch-file called "Start-Jupyter-Here.bat":
It is pretty much what was suggested above, but you can copy this batch file into any folder and directly launch Jupyter by double-clicking the batch file in that folder Works on network shares as well.
ericpre commentedon Nov 22, 2020
A slightly different approach may be to use a shortcut in the context menu: https://pypi.org/project/start-jupyter-cm.
BerlXIII commentedon Nov 22, 2020
Very cool, @joeheaven's solution works! But I guess @ericpre's solution is even more uncomplicated...
e-d-n-a commentedon Feb 10, 2021
I suggest another "Start_Jupyter [WPy-x64-3760ps2].cmd" to run a Jupyter Notebook-server in the directory of the script:
You should put the script in the root-folder of your notebooks' location and run the script via a shortcut from anywhere.
So, here the folders for the installation and notebooks are fixed, but not the same.
The working directory should be changed from within the chosen notebook.
stonebig commentedon Feb 13, 2021
trying something in next build, with this that may work
"winipython_notebook.bat E:\my_code\my_notebook.ipynb"
trying to open in the "desired" directory for idle/spyder/jupyter
coimbrarodrigo commentedon Mar 20, 2023
Open a text editor such as Notepad.
Copy and paste the following code into the text editor:
Save the file with a .bat extension, such as "launch_jupyter.bat".
Navigate to the WinPython64-3.11.1\scripts directory.
Move the batch file you created in Step 3 to the scripts directory.
Double-click the batch file to run it.
Jupyter Notebook should launch in the C: drive. From there, you can navigate to any other directory or file on your system.
That's it! You should now be able to launch Jupyter Notebook in the C: drive by running the batch file you created.
~roco
bb4245 commentedon May 16, 2023
This an older query now but I have come across an easier solution while looking through these answers
Open winpython command prompt
cd to folder you want
enter the following in command prompt
jupyter notebook
This will open jupyter in directory specified