简体   繁体   中英

How to activate anaconda environments properly after installing visual studio 2019

After installing Visual Studio 2019, I have problems with my anaconda. When I create a new environemnt in my anaconda, after hours I face the problem when I try to activate the environment and after that when I open any jupyter notebook, the kernel will not work. I copied the messages when I activate environment. How can I recover my anaconda environments? I have uninstalled the Visual Studio and deleted all its files but the problem is still here. I appreciate any help to solve this issue. I am using Windows 10 and Anaconda 3.

(base) C:\>conda activate enviro

C:\>SET DISTUTILS_USE_SDK=1

C:\>SET MSSdk=1

C:\>SET "VS_VERSION=15.0"

C:\>SET "VS_MAJOR=15"

C:\>SET "VS_YEAR=2017"

C:\>set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"

C:\>set "MSYS2_ENV_CONV_EXCL=CL"

C:\>set "PY_VCRUNTIME_REDIST=\bin\vcruntime140.dll"

C:\>set "CXX=cl.exe"

C:\>set "CC=cl.exe"

C:\>set "VSINSTALLDIR="

C:\>for /F "usebackq tokens=*" %i in (`vswhere.exe -nologo -products * -version [15.0,16.0) -property installationPath`) do (set "VSINSTALLDIR=%i\" )

C:\>if not exist "" (for /F "usebackq tokens=*" %i in (`vswhere.exe -nologo -products * -requires Microsoft.VisualStudio.Component.VC.v141.x86.x64 -property installationPath`) do (set "VSINSTALLDIR=%i\" ) )

C:\>if not exist "" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\" )

C:\>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\" )

C:\>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\" )

C:\>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\" )

C:\>IF NOT "" == "" (
set "INCLUDE=;"
 set "LIB=;"
 set "CMAKE_PREFIX_PATH=;"
)

C:\>call :GetWin10SdkDir

C:\>call :GetWin10SdkDirHelper HKLM\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\>if errorlevel 1 call :GetWin10SdkDirHelper HKLM\SOFTWARE  1>nul 2>&1

C:\>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE  1>nul 2>&1

C:\>if errorlevel 1 exit /B 1

C:\>exit /B 0

C:\>for /F %i in ('dir /ON /B "\include\10.*"') DO (SET WindowsSDKVer=%~i )
The system cannot find the file specified.

C:\>if errorlevel 1 (echo "Didn't find any windows 10 SDK. I'm not sure if things will work, but let's try..." )  else (echo Windows SDK version found as: "" )
Windows SDK version found as: ""

C:\>IF "win-64" == "win-64" (
set "CMAKE_GEN=Visual Studio 15 2017 Win64"
 set "BITS=64"
)  else (
set "CMAKE_GEN=Visual Studio 15 2017"
 set "BITS=32"
)

C:\>pushd C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
The system cannot find the path specified.

C:\>CALL "VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.16
The system cannot find the path specified.

C:\>popd

C:\>IF "" == "" SET "CMAKE_GENERATOR=Visual Studio 15 2017 Win64"

C:\>call :GetWin10SdkDirHelper HKLM\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\>if errorlevel 1 call :GetWin10SdkDirHelper HKLM\SOFTWARE  1>nul 2>&1

C:\>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE  1>nul 2>&1

C:\>if errorlevel 1 exit /B 1

C:\>exit /B 0

(enviro) C:\>

It was solved by removeing the vs2017_compiler_vars file that was in Anaconda3\envs\enviro\etc\conda\activate.d .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM