I'm trying to update a python environment in miniconda, using a yaml file.
I tried it in 2 ways -
When I run the command
subprocess.run("conda env update -n env2 -f path_to_yaml_file")in a python script (the python interpreter is a in an existing python-miniconda environment (env1), and I updating a differed environment (env2)), it fail with the following message:ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\2\\pip-uninstall-5c5jvd44\\normalizer.exe' Consider using the '--user' option or check the permissions. CondaValueError: pip returned an errorWhen I'm running the same command
conda env update -n env2 -f path_to_yaml_filein a CMD window, it update the environment successfully.
Does anyone knows what is the cause of the difference between the 2 actions? How can I resolve it?
Clerifications:
- I can not add the
--useroption to aconda updatecommand, because it is a pip option and not a conda option. - The miniconda folder is under
C:\Users\Administrator