dutchbrazerzkidai.blogg.se

Anaconda prompt in windows terminal
Anaconda prompt in windows terminal








anaconda prompt in windows terminal

" %HAS_PLACEHOLDER% " = "True " REM If it did, replace it with our NEW_PATH REM Delayed expansion used here to do replacement with value of NEW_PATH SET " PATH = %%PATH:CONDA_PATH_PLACEHOLDER= !NEW_PATH! %% "

#Anaconda prompt in windows terminal full#

SET " PROMPT =( %CONDA_NEW_ENV%) %PROMPT% REM always store the full path to the environment, since CONDA_DEFAULT_ENV varies /F "tokens=1 delims= " %%i in ( " %NEW_PATH% ") DO SET " CONDA_PREFIX = %%i " REM Do we have CONDA_PATH_PLACEHOLDER in PATH? SET " CHECK_PLACEHOLDER =import os print('CONDA_PATH_PLACEHOLDER' in os.environ) " /F "tokens=1 delims= " %%i in (' " %~dp0\.\python " -c " %CHECK_PLACEHOLDER% "') DO SET " HAS_PLACEHOLDER = %%i " REM look if the deactivate script left a placeholder for us. changeps1') DO SET " CHANGE_PROMPT = %%i " errorlevel 1 exit /b 1 :: if our prompt var does not contain reference to CONDA_DEFAULT_ENV, set prompt " %CHANGE_PROMPT% " = "1 " "x %PROMPT: CONDA_DEFAULT_ENV=% " = "x %PROMPT% " ( current path followed by greater sign NOT DEFINED PROMPT SET PROMPT SET " CONDA_PS1_BACKUP = %PROMPT% " /F "delims= " %%i IN (' " %CONDA_EXE% ". activate "cmd.exe " " %CONDA_NEW_ENV% "') DO SET " NEW_PATH = %%i " errorlevel 1 exit /b 1 REM take a snapshot of pristine state for later REM if PROMPT is not set at all, explicitly set it to the default, i.e. checkenv "cmd.exe " " %CONDA_NEW_ENV% " errorlevel 1 exit /b 1 REM The argument here tells the deactivate script to leave a placeholder for us when it removes PATH entries, REM so that we can put our new path entries back in the same place " %~dp0\deactivate.bat " "hold " errorlevel 1 exit /b 1 REM Activate the new environment /F "delims= " %%i IN (' " %CONDA_EXE% ". : skipmissingarg REM Ensure that path or name passed is valid before deactivating anything " %CONDA_EXE% ".

anaconda prompt in windows terminal

: skiptoomanyargs not " %~1 " = " " REM Set env to root if no arg provided set CONDA_NEW_ENV =root ( echo Error: did not expect more than one argument.) 1 >&2 :: reset errorlevel to 0 cmd /c "exit /b 0 " %~2 " = " " skiptoomanyargs setlocal enabledelayedexpansion /F "delims= " %%i IN (' " %~dp0.\python.exe " -c "import ctypes print(()) "') DO SET " PYTHONIOENCODING = %%i " chcp !PYTHONIOENCODING! > NUL set " CONDA_NEW_ENV = %~1 " SET " CONDA_EXE = %~dp0\.\Scripts\conda.exe " :: this finds either -help or -h and shows the help text ECHO " %~1 " | %SystemRoot%\System32\find.exe /I "-h " 1 > NUL NOT ERRORLEVEL 1 " %CONDA_EXE% ". REM For debugging, remove the on the section you need to study. REM Setting it this way allows us to not touch the user's echo setting. REM symbols in this file indicate that output should not be printed.










Anaconda prompt in windows terminal