I'm new to coding but I simply want to change directory and run jupyter. The problem is cmd instantly closes once it reaches the jupyter notebook command. Tried cmd /k too but it doesn't have an effect. I must being doing this wrong.
F:
cd directoryname
activate environmentname
jupyter notebook
pause
Solution: The commands were closing the prompt for some reason when executed in a .bat (they don't when typed). The fix was to type call before the commands.
F:
cd directoryname
call activate environmentname
call jupyter notebook
pause
Change Jupyter Notebook startup folder (Windows) Copy the Jupyter Notebook launcher from the menu to the desktop. Right click on the new launcher and change the Target field, change %USERPROFILE% to the full path of the folder which will contain all the notebooks.
How to change the working directory of Jupyter and Jupyter Lab on Windows environment. Open cmd (or Anaconda Prompt) and run jupyter notebook --generate-config . This writes a file to C:\Users\username\. jupyter\jupyter_notebook_config.py .
How do I schedule a Jupyter Notebook to run? When your Jupyter notebook is ready for scheduling, open the Schedule runs option inside the Computation tab or access it from the Run menu in Datalore. Then choose the run interval (hourly, daily, weekly, monthly) and the time zone.
The commands were closing the prompt for some reason when executed in a .bat (they don't when typed). The fix was to type call before the commands.
F:
cd directoryname
call activate environmentname
call jupyter notebook
pause
Create a simple batch file (jnote.bat):
@echo off
call jupyter notebook "%CD%"
pause
In the same folder create a shortcut to the batch file and rename it to jupyter-notebook.
Open the shortcut properties and change the icon to the jupyter.ico. You will find this in the .\Menu sub-folder in your Anaconda distribution. You should now have a shortcut with the) nice jupyter icon.
Copy the shortcut to all the folders that you use for your notebooks. Double-click the shortcut to open jupyter-notebook that folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With