Created
September 8, 2021 21:05
-
-
Save rokdd/b2f5e7619f9921862206d2e80861637b to your computer and use it in GitHub Desktop.
Run python script with virtual envoirement in windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem this scripts start a python script with a virtual envoirement (venv) from commandline | |
rem for improvements or questions contact www.rokdd.xyz | |
rem ------ | |
rem please put your path of the virtual envoirement here (the directory contains a activate.bat): | |
set path_env=C:\<....>\Scripts | |
rem then we will add the path to the global PATH (you can also add more libraries from other directorys) | |
set PATH=%path_env%;%PATH% | |
rem remove the rem of next line when you want to use anaconda | |
rem call C:\Users\<username>\anaconda3\condabin\activate "<your env name>" | |
rem activate the envoirement | |
call "%path_env%\activate.bat" | |
rem now we forward to python to the path including all arguments | |
"%path_env%\python.exe" 000-latest\main.py %* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment