Conda update failed in python script and pass on CMD window

Viewed 39

I'm trying to update a python environment in miniconda, using a yaml file.

I tried it in 2 ways -

  1. 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 error

  2. When I'm running the same command conda env update -n env2 -f path_to_yaml_file in 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:

  1. I can not add the --user option to a conda update command, because it is a pip option and not a conda option.
  2. The miniconda folder is under C:\Users\Administrator
1 Answers

Update normalizer to the newest version fixed it

Related