batch command inside python virtual env

Question:

I have a .bat script that does

cd documents/code/project
env/scripts/activate.bat

but one is there, as expected, the path is not

C:UsersUserDocumentsCodeProject>

but

(env) C:UsersUserDocumentsCodeProject>

So, for example, if I add other command to the batch script it won’t get it because the virtual environment is not accessible

let’s supose I just want to change directory but with the environment already active. i.e.

cd documents/code/project
env/scripts/activate.bat
cd folderInProject

How can I do it?

Thanks

Asked By: jfcabreras

||

Answers:

Thanks @Compo, @MattDMo for your comments, they opened my mind a lot and I’ll have to study.

The solution is:

CD "documentscodeproject"
Call "envscriptsactivate.bat"
CD "src"

but actually what I was looking was:

CD "documentscodeproject"
Call "envscriptsactivate.bat"
Call python test.py

Just wanted to know how to be able to send batch commands once the env was already active.

Answered By: jfcabreras
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.