title: python, conda: ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'd:\\anaconda3\\envs\\python39\\scripts\\pip.exe'
body: <p>I have tried to install <code>requirements.txt</code> using <code>pip install -r requirements.txt</code>. I always get this error:</p>
  <pre><code>  Using cached ansicon-1.89.0-py2.py3-none-any.whl (63 kB)
  Installing collected packages: ansicon, wcwidth, six, jinxed, urllib3, readchar, python-editor, python-dateutil, jmespath, idna, chardet, certifi, blessed, requests, pyyaml, pip, mypy-extensions, inquirer, click, botocore, attrs, rollbar, redis, chalice
    Attempting uninstall: pip
      Found existing installation: pip 21.3.1
      Uninstalling pip-21.3.1:
  ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'd:\\anaconda3\\envs\\python39\\scripts\\pip.exe'
  Consider using the `--user` option or check the permissions.
  </code></pre>
  <blockquote>
  <p>Note that I am using windows 10 as OS.</p>
  </blockquote>
  <p>I find out that the process of installation <strong>&quot;removes my pip script&quot;</strong> from Scripts, that is why I run <code>pip install -r requirements.txt --user</code> I got</p>
  <pre><code>Cannot open D:\anaconda3\envs\python39\Scripts\pip-script.py
  </code></pre>
  <p>I have also tried to upgrade pip but could not</p>
  <pre><code>Cannot open D:\anaconda3\envs\python39\Scripts\pip-script.py
  </code></pre>
  <p>For those who may say try to install pip via conda first I am getting:</p>
  <pre><code>$ conda install pip
  Collecting package metadata (current_repodata.json): done
  Solving environment: done
  
  
  ==&gt; WARNING: A newer version of conda exists. &lt;==
    current version: 4.10.1
    latest version: 4.10.3
  
  Please update conda by running
  
      $ conda update -n base -c defaults conda     
  
  
  
  # All requested packages already installed.
  </code></pre>
  <p>I have run the command as administrator, I have tried many versions of python within <code>conda</code>. I have also installed python globally (once I restart my system the global python folder vanish). I have also tried to install the requirements file with conda but it does not find the <code>chalice</code> and <code>rollbar</code> in conda or conda forge channel.</p>
  <p>This is my <code>requirements.txt</code></p>
  <pre><code>chalice==1.23.0
  requests==2.25.1
  rollbar==0.15.2
  redis==3.5.3
  </code></pre>
  <p>How could I fix this?</p>