GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — how to run notebook from any folder on computer · Issue #848 · winpython/winpython

how to run notebook from any folder on computer #848

New issue
Copy link
New issue
Copy link
Open
Open
how to run notebook from any folder on computer#848
Copy link
Labels
ProcedureProcedureProcedure
Milestone
2021-01 Jupyterlab-3.0

Description

@Sandy4321
Sandy4321
opened on Apr 26, 2020
Issue body actions

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

Activity

  1. stonebig commented on Apr 26, 2020

    @stonebig
    stonebig
    on Apr 26, 2020
    Contributor
    More actions

    did you try drag & drop the notebook on jupyterlab icon ?

  2. stonebig commented on Apr 26, 2020

    @stonebig
    stonebig
    on Apr 26, 2020
    Contributor
    More actions

    with Winpython64-3.8.2.1codb2.exe, you can also try drag & drop the notebook on VSCode icon.

  3. Sandy4321 commented on Apr 26, 2020

    @Sandy4321
    Sandy4321
    on Apr 26, 2020
    Author
    More actions

    so no way to run from command line
    something like this

    Jupyter Notebook.exe E:\my_code\my_notebook.ipynb
    ?

  4. stonebig commented on May 1, 2020

    @stonebig
    stonebig
    on May 1, 2020
    Contributor
    More actions

    the icon is doing what is in scripts\winjupyter_lab.bat:

    @echo off
    call "%~dp0env_for_icons.bat"
    cd/D "%WINPYWORKDIR%"
    "%WINPYDIR%\scripts\jupyter-lab.exe" %*
    

    so to call E:\my_code\my_notebook.ipynb, you can do:

    call "E:\WINPYTHON_FULL_apr22\WPy64-3770\scripts\env_for_icons.bat"
    "%WINPYDIR%\scripts\jupyter-lab.exe" "E:\my_code\my_notebook.ipynb"
    
  5. Sandy4321 commented on May 1, 2020

    @Sandy4321
    Sandy4321
    on May 1, 2020
    Author
    More actions

    unbelievable , so complicated...

  6. stonebig commented on May 1, 2020

    @stonebig
    stonebig
    on May 1, 2020
    Contributor
    More actions

    maybe they have better ideas on stackoverflow, you may ask there

  7. BerlXIII commented on Jun 21, 2020

    @BerlXIII
    BerlXIII
    on Jun 21, 2020
    More actions

    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...

  8. joeheaven commented on Aug 15, 2020

    @joeheaven
    joeheaven
    on Aug 15, 2020
    More actions

    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":

    @echo off
    echo 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!
    set wipypfad=c:\WinPython-64bit-3.6.1.0Qt5
    echo We use %wipypfad%
    if not exist %wipypfad%\scripts\env_for_icons.bat echo Path not correct! %wipypfad%\scripts\env_for_icons.bat not found! EXIT
    if not exist %wipypfad%\scripts\env_for_icons.bat goto :EndHere
    echo.
    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.

  9. ericpre commented on Nov 22, 2020

    @ericpre
    ericpre
    on Nov 22, 2020
    More actions

    A slightly different approach may be to use a shortcut in the context menu: https://pypi.org/project/start-jupyter-cm.

  10. BerlXIII commented on Nov 22, 2020

    @BerlXIII
    BerlXIII
    on Nov 22, 2020
    More actions

    Very cool, @joeheaven's solution works! But I guess @ericpre's solution is even more uncomplicated...

  11. e-d-n-a commented on Feb 10, 2021

    @e-d-n-a
    e-d-n-a
    on Feb 10, 2021
    More actions

    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.

  12. stonebig commented on Feb 13, 2021

    @stonebig
    stonebig
    on Feb 13, 2021
    Contributor
    More actions

    trying something in next build, with this that may work

    "winipython_notebook.bat E:\my_code\my_notebook.ipynb"

  13. stonebig
    added this to the 2021-01 Jupyterlab-3.0 milestone on Feb 13, 2021
  14. stonebig
    added a commit that references this issue on Feb 13, 2021

    trying to open in the "desired" directory for idle/spyder/jupyter

    da320ed
  15. coimbrarodrigo commented on Mar 20, 2023

    @coimbrarodrigo
    coimbrarodrigo
    on Mar 20, 2023
    More actions
    1. Open a text editor such as Notepad.

    2. Copy and paste the following code into the text editor:

    @echo off
    call "%~dp0env_for_icons.bat" %*
    cd /d "C:\"
    "%WINPYDIR%\scripts\jupyter-notebook.exe" %*
    
    1. Save the file with a .bat extension, such as "launch_jupyter.bat".

    2. Navigate to the WinPython64-3.11.1\scripts directory.

    3. Move the batch file you created in Step 3 to the scripts directory.

    4. Double-click the batch file to run it.

    5. 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

  16. bb4245 commented on May 16, 2023

    @bb4245
    bb4245
    on May 16, 2023
    More actions

    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

  17. stonebig
    added
    ProcedureProcedureProcedure
    on May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ProcedureProcedureProcedure

    Type

    No type

    Projects

    No projects

      Milestone

      • 2021-01 Jupyterlab-3.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.