PermissionError: [WinError 5] Access is denied: 'C:\\Program Files\\Anaconda3\\pkgs\\vs2015_runtime-14.0.25123-0.tmp

Mona Jalal picture Mona Jalal · Jan 12, 2017 · Viewed 20.9k times · Source

Conda newbie here! How can I solve this problem?

C:\Users\mona>conda create --name universe-starter-agent python=3.5
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment C:\Users\mona\.conda\envs\universe-starter-agent:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pip-9.0.1                  |           py35_1         1.7 MB

The following NEW packages will be INSTALLED:

    pip:            9.0.1-py35_1
    python:         3.5.2-0       (copy)
    setuptools:     27.2.0-py35_1 (copy)
    vs2015_runtime: 14.0.25123-0  (copy)
    wheel:          0.29.0-py35_0 (copy)

Proceed ([y]/n)? y

Fetching packages ...
pip-9.0.1-py35 100% |###############################| Time: 0:00:00   2.94 MB/s
Extracting packages ...
WARNING conda.lock:touch(53): Failed to create lock, do not run conda in parallel processes [errno 13]
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



Current conda install:

               platform : win-64
          conda version : 4.2.9
       conda is private : False
      conda-env version : 4.2.9
    conda-build version : 2.0.2
         python version : 3.5.2.final.0
       requests version : 2.11.1
       root environment : C:\Program Files\Anaconda3  (read only)
    default environment : C:\Program Files\Anaconda3
       envs directories : C:\Users\mona\.conda\envs
                          C:\Program Files\Anaconda3\envs
          package cache : C:\Users\mona\.conda\envs\.pkgs
                          C:\Program Files\Anaconda3\pkgs
           channel URLs : https://repo.continuum.io/pkgs/free/win-64/
                          https://repo.continuum.io/pkgs/free/noarch/
                          https://repo.continuum.io/pkgs/pro/win-64/
                          https://repo.continuum.io/pkgs/pro/noarch/
                          https://repo.continuum.io/pkgs/msys2/win-64/
                          https://repo.continuum.io/pkgs/msys2/noarch/
            config file : None
           offline mode : False



`$ C:\Program Files\Anaconda3\Scripts\conda-script.py create --name universe-starter-agent python=3.5`




    Traceback (most recent call last):
      File "C:\Program Files\Anaconda3\lib\site-packages\conda\exceptions.py", line 473, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "C:\Program Files\Anaconda3\lib\site-packages\conda\cli\main.py", line 144, in _main
        exit_code = args.func(args, p)
      File "C:\Program Files\Anaconda3\lib\site-packages\conda\cli\main_create.py", line 68, in execute
        install(args, parser, 'create')
      File "C:\Program Files\Anaconda3\lib\site-packages\conda\cli\install.py", line 405, in install
        execute_actions(actions, index, verbose=not context.quiet)
      File "C:\Program Files\Anaconda3\lib\site-packages\conda\plan.py", line 643, in execute_actions
        inst.execute_instructions(plan, index, verbose)
      File "C:\Program Files\Anaconda3\lib\site-packages\conda\instructions.py", line 134, in execute_instructions
        cmd(state, arg)
      File "C:\Program Files\Anaconda3\lib\site-packages\conda\instructions.py", line 58, in EXTRACT_CMD
        extract(arg)
      File "C:\Program Files\Anaconda3\lib\site-packages\conda\install.py", line 801, in extract
        t.extractall(path=temp_path)
      File "C:\Program Files\Anaconda3\lib\tarfile.py", line 1996, in extractall
        numeric_owner=numeric_owner)
      File "C:\Program Files\Anaconda3\lib\tarfile.py", line 2038, in extract
        numeric_owner=numeric_owner)
      File "C:\Program Files\Anaconda3\lib\tarfile.py", line 2100, in _extract_member
        os.makedirs(upperdirs)
      File "C:\Program Files\Anaconda3\lib\os.py", line 231, in makedirs
        makedirs(head, mode, exist_ok)
      File "C:\Program Files\Anaconda3\lib\os.py", line 241, in makedirs
        mkdir(name, mode)

I am getting this error

PermissionError: [WinError 5] Access is denied: 'C:\Program Files\Anaconda3\pkgs\vs2015_runtime-14.0.25123-0.tmp'

Answer

Krishna Choudhary picture Krishna Choudhary · Jun 25, 2018

METHOD 1:

Try opening your terminal as admin.

METHOD 2:

If METHOD 1 doesn't work, add "--user" at then end of install command.

For example: pip install --ignore-installed --upgrade tensorflow --user

METHOD 3:

If this doesn't work either, the PATH variable might not be set. In that case, path should be printed as warning. Add these path by following steps:

3.1. Right click on my computer->properties

3.2. Advanced system settings

3.3. Under Advanced tab, select environment variables.

3.4. Click new, name the variable name as 'PATH' and value as the directory given in warning.

Hope this help :)