Parthasarathy Subburaj
Parthasarathy Subburaj

Reputation: 4264

Windows batch file fails to continue after user input is received

I am trying to execute a .bat file for creating an environment in conda and I am using the following script:

set HTTPS_PROXY=<some_value>  #will be setting some value
set HTTPS_PROXY=<some_vale>   #will be setting some value
conda create -n SATENV python=3.6 
activate SATENV 
set HTTPS_PROXY=<some_value>  #will be setting some value
set HTTPS_PROXY=<some_vale>   #will be setting some value
pip install -r requirements.txt  
python -m spacy download en 
python -m nltk.downloader stopwords 
conda deactivate 
python -m ipykernel install --user --name SATENV --display-name "SATENV"

In line number three conda create -n SATENV python=3.6 the batch script expects a user input (yes or no) to proceed for installing the new packages and as soon as the user responds, line three executes and the batch file stops executing other lines. Any leads on this will be really helpful.

Thanks in advance.

Upvotes: 0

Views: 71

Answers (1)

Compo
Compo

Reputation: 38719

Given that conda and activate are batch files:

Change:

conda create -n SATENV python=3.6 
activate SATENV 

To:

call conda.bat create -n SATENV python=3.6 -y
call activate.bat SATENV

Please note that I have also added the -y option to answer yes to any subsequent prompts, and prevent waiting to the end user to do so.

Upvotes: 1

Related Questions