-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
121 additions
and
48 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/home/$USER/anaconda3/python | ||
|
||
start_syncfiles |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@echo OFF | ||
rem How to run a Python script in a given conda environment from a batch file. | ||
|
||
rem It doesn't require: | ||
rem - conda to be in the PATH | ||
rem - cmd.exe to be initialized with conda init | ||
|
||
rem Define here the path to your conda installation | ||
set CONDAPATH=C:\Users\%USERNAME%\Anaconda3\ | ||
rem Define here the name of the environment | ||
set ENVNAME=base | ||
|
||
rem The following command activates the base environment. | ||
rem call C:\ProgramData\Miniconda3\Scripts\activate.bat C:\ProgramData\Miniconda3 | ||
if %ENVNAME%==base (set ENVPATH=%CONDAPATH%) else (set ENVPATH=%CONDAPATH%\envs\%ENVNAME%) | ||
|
||
rem Activate the conda environment | ||
rem Using call is required here, see: https://stackoverflow.com/questions/24678144/conda-environments-and-bat-files | ||
call %CONDAPATH%\Scripts\activate.bat %ENVPATH% | ||
|
||
rem Run a python script in that environment | ||
python start_syncfiles | ||
|
||
rem Deactivate the environment | ||
call conda deactivate | ||
|
||
rem If conda is directly available from the command line then the following code works. | ||
rem call activate someenv | ||
rem python script.py | ||
rem conda deactivate | ||
|
||
rem One could also use the conda run command | ||
rem conda run -n someenv python script.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/home/$USER/anaconda3/python | ||
|
||
start_telrun |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@echo OFF | ||
rem How to run a Python script in a given conda environment from a batch file. | ||
|
||
rem It doesn't require: | ||
rem - conda to be in the PATH | ||
rem - cmd.exe to be initialized with conda init | ||
|
||
rem Define here the path to your conda installation | ||
set CONDAPATH=C:\Users\%USERNAME%\Anaconda3\ | ||
rem Define here the name of the environment | ||
set ENVNAME=base | ||
|
||
rem The following command activates the base environment. | ||
rem call C:\ProgramData\Miniconda3\Scripts\activate.bat C:\ProgramData\Miniconda3 | ||
if %ENVNAME%==base (set ENVPATH=%CONDAPATH%) else (set ENVPATH=%CONDAPATH%\envs\%ENVNAME%) | ||
|
||
rem Activate the conda environment | ||
rem Using call is required here, see: https://stackoverflow.com/questions/24678144/conda-environments-and-bat-files | ||
call %CONDAPATH%\Scripts\activate.bat %ENVPATH% | ||
|
||
rem Run a python script in that environment | ||
python start_telrun | ||
|
||
rem Deactivate the environment | ||
call conda deactivate | ||
|
||
rem If conda is directly available from the command line then the following code works. | ||
rem call activate someenv | ||
rem python script.py | ||
rem conda deactivate | ||
|
||
rem One could also use the conda run command | ||
rem conda run -n someenv python script.py |
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
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