0

Hi I have a Jupyerlab notebook called:

SQL Queries.ipynb which runs off the environment QueryEnv in Anaconda.

The file lives in the directory C:\Users\Latitude User\OneDrive\Projects\

Is there a way in which to run a notebook file as a .bat or do i have to convert the notebook to a .py file?

Previously i have used the following .bat scripts for a .py file in the ModelEnv of Anaconda:

@ECHO OFF 
TITLE Execute python script on anaconda environment
ECHO Please Wait...
:: Section 1: Activate the environment.
ECHO ============================
ECHO Conda Activate
ECHO ============================
@CALL "C:\Users\Latitude User\anaconda3\Scripts\activate.bat" ModelEnv
:: Section 2: Execute python script.
ECHO ============================
ECHO Model.py
ECHO ============================
python "C:\Users\Latitude User\OneDrive\Projects\Model.py"
ECHO ============================
ECHO End
ECHO ============================

PAUSE

Can I do this for a notebook file? Thanks in advance!

SOK
  • 1,732
  • 2
  • 15
  • 33
  • 1
    Does this answer your question? [How to run an .ipynb Jupyter Notebook from terminal?](https://stackoverflow.com/questions/35545402/how-to-run-an-ipynb-jupyter-notebook-from-terminal) – It_is_Chris Jul 01 '21 at 13:13
  • The question is more MAC based but I was hoping to get some help with the Anaconda element as well. Whether I can activate the Anaconda environment and then run the notebook like I have done with .py as above – SOK Jul 01 '21 at 13:18

0 Answers0