'Miniconda3 installation pythomcom39.dll error (the procedure entry point could not be located in the dynamic link library)

I installed miniconda latest version. I also installed following packages. But when I run my python in miniconda3 environment I getting error saying that "the procedure entry point <...> could not be located in the dynamic link library ../../pythomcom39.dll".

My installation batch file for miniconda and conda environment:

@echo off

set ORIGDIR="%CD%"

set MINICONDAPATH=%USERPROFILE%\Miniconda3
set CONDAINSTALLER=%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%-condainstall.exe
set "OS="
set "MCLINK="

where conda >nul 2>nul
if %ERRORLEVEL% EQU 0 goto CONDAFOUND

:INSTALLCONDA
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT
if %OS%==32BIT set MCLINK=https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86.exe
if %OS%==64BIT set MCLINK=https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe

echo Downloading Miniconda3 (This will take while, please wait)...
powershell -Command "(New-Object Net.WebClient).DownloadFile('%MCLINK%', '%CONDAINSTALLER%')" >nul 2>nul
if errorlevel 1 goto CONDAERROR

echo Installing Miniconda3 (This will also take a while, please wait)...
start /wait /min "Installing Miniconda3..." "%CONDAINSTALLER%" /InstallationType=JustMe /S /D="%MINICONDAPATH%"
del "%CONDAINSTALLER%"
if not exist "%MINICONDAPATH%\" (goto CONDAERROR)

echo Miniconda3 has been installed!

call %MINICONDAPATH%/Scripts/activate.bat %MINICONDAPATH%
call conda create -y -n=testenv python=3.9 anaconda
call conda activate testenv
call conda install -y pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
call pip install albumentations --quiet

goto END

:CONDAERROR
echo Miniconda3 install failed!
exit /B 1

:CONDAFOUND
echo Conda is already installed!

goto END

:END
exit /B 0

Python error



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source