How to 'conda env create -f environment.yml' using 'pip --user' method

Viewed 2591

I am running into a permissions error when trying to create a conda environment from environment.yml.

Code:

conda env update -f environment.yml

Result:

Pip subprocess error:
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\pip-uninstall-y6pkbh0y\\_cffi_backend.cp36-win_amd64.pyd'

Consider using the `--user` option or check the permissions.

Is it possible to run a conda installation while using the --user flag for pip? I don't see anything in the documentation. This is happening on an azure app-service instance so I don't think that running as administrator is an option.

As requested, here is the yml used in azure pipelines:

- task: CondaEnvironment@0
  inputs:
    environmentName: 'REDACTED' 
    packageSpecs: 'python=3.6.10'
  displayName: 'Install Conda'

- script: |
    conda env update -p C:\Miniconda\envs -f environment.yml
  displayName: 'Sync Conda Environment'

UPDATE: Azure app service does not allow you to run conda using administrator previledges. To anyone tempted to try and run azure app service with conda: Don't bother. It's not supported and it's not worth the headache trying to get around it. I have everything working just fine on a azure windows server VM running a wfastcgi API with IIS 6.

1 Answers

You have to run cmd as admin and type the same command again. If you don't have admin permissions as you say you should add this to your command -p as follows.

conda env update -p C:\ProgramData\Miniconda3\envs -f environment.yml
Related