Closed maphew closed 5 years ago
@maphew, yes I noticed that too. I think that a wrapping batch script that activates the base environment is needed. I think I have a plan for that...
This seems to work here:
activate-and-call-test.bat:
%windir%\system32\cmd.exe /K ""C:\apps\Miniconda3\Scripts\activate.bat" "C:\apps\Miniconda3" && %*"
In use:
Matt@SERVER D:\Matt\code
$ activate-and-call-test.bat python needs-activation-to-run.py
Matt@SERVER D:\Matt\code
$ C:\WINDOWS\system32\cmd.exe /K ""C:\apps\Miniconda3\Scripts\activate.bat" "C:\apps\Miniconda3" && python needs-activation-to-run.py"
Sqlite version: 3.29.0
I got the base syntax from https://github.com/conda/conda/blob/master/conda/shell/Scripts/activate.bat. The command is very sensitive to quote placement.
Possibly more complete wrapper:
%windir%\system32\cmd.exe /K ""C:\apps\Miniconda3\Scripts\activate.bat" && %* && conda deactivate"
On a Windows machine using Conda to manage it's python environments some scripts need more help than just creating a shortcut to
python path/to/script.py
. For example this will fail outside ofconda activate xxxx
:Discovered downstream at https://github.com/leo-editor/leo-editor/issues/1300