title: Command errored out with exit status 1 and access denied
body: <p>Recently I installed anaconda. Now, I uninstalled Anaconda and reinstalled python 3.6. I am not a able to install some packages because of the following error.</p>
  <pre><code>Collecting pyinstaller
    Using cached pyinstaller-4.0.tar.gz (3.5 MB)
    Installing build dependencies ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\dell\appdata\local\programs\python\python36\python.exe' 'c
  :\users\dell\appdata\local\programs\python\python36\lib\site-packages\pip' insta
  ll --ignore-installed --no-user --prefix 'C:\Users\DELL\AppData\Local\Temp\pip-b
  uild-env-nt65tuv0\overlay' --no-warn-script-location --no-binary :none: --only-b
  inary :none: -i https://pypi.org/simple -- 'setuptools&gt;=40.8.0' wheel
         cwd: None
    Complete output (14 lines):
    Traceback (most recent call last):
      File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\runpy.py&quot;, li
  ne 193, in _run_module_as_main
        &quot;__main__&quot;, mod_spec)
      File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\runpy.py&quot;, li
  ne 85, in _run_code
        exec(code, run_globals)
      File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages
  \pip\__main__.py&quot;, line 23, in &lt;module&gt;
        from pip._internal.cli.main import main as _main  # isort:skip # noqa
      File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages
  \pip\_internal\cli\main.py&quot;, line 5, in &lt;module&gt;
        import locale
      File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\locale.py&quot;, l
  ine 16, in &lt;module&gt;
        import re
      File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\re.py&quot;, line
  142, in &lt;module&gt;
        class RegexFlag(enum.IntFlag):
    AttributeError: module 'enum' has no attribute 'IntFlag'
    ----------------------------------------
  ERROR: Command errored out with exit status 1: 'c:\users\dell\appdata\local\prog
  rams\python\python36\python.exe' 'c:\users\dell\appdata\local\programs\python\py
  thon36\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\
  Users\DELL\AppData\Local\Temp\pip-build-env-nt65tuv0\overlay' --no-warn-script-l
  ocation --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 's
  etuptools&gt;=40.8.0' wheel Check the logs for full command output.
  Traceback (most recent call last):
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\contextlib2.py&quot;, line 468, in __exit__
      if cb(*exc_details):
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\contextlib2.py&quot;, line 396, in _exit_wrapper
      return cm_exit(cm, *exc_details)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_internal\utils\temp_dir.py&quot;, line 175, in __exit__
      self.cleanup()
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_internal\utils\temp_dir.py&quot;, line 199, in cleanup
      rmtree(ensure_text(self._path))
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\retrying.py&quot;, line 49, in wrapped_f
      return Retrying(*dargs, **dkw).call(f, *args, **kw)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\retrying.py&quot;, line 212, in call
      raise attempt.get()
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\retrying.py&quot;, line 247, in get
      six.reraise(self.value[0], self.value[1], self.value[2])
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\six.py&quot;, line 703, in reraise
      raise value
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\retrying.py&quot;, line 200, in call
      attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_internal\utils\misc.py&quot;, line 139, in rmtree
      onerror=rmtree_errorhandler)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py&quot;, lin
  e 488, in rmtree
      return _rmtree_unsafe(path, onerror)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py&quot;, lin
  e 378, in _rmtree_unsafe
      _rmtree_unsafe(fullname, onerror)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py&quot;, lin
  e 378, in _rmtree_unsafe
      _rmtree_unsafe(fullname, onerror)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py&quot;, lin
  e 378, in _rmtree_unsafe
      _rmtree_unsafe(fullname, onerror)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py&quot;, lin
  e 383, in _rmtree_unsafe
      onerror(os.unlink, fullname, sys.exc_info())
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py&quot;, lin
  e 381, in _rmtree_unsafe
      os.unlink(fullname)
  PermissionError: [WinError 5] Access is denied: 'C:\\Users\\DELL\\AppData\\Local
  \\Temp\\pip-install-k22kzs5t\\pyinstaller\\PyInstaller\\bootloader\\Windows-32bi
  t\\run.exe'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\runpy.py&quot;, line
   193, in _run_module_as_main
      &quot;__main__&quot;, mod_spec)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\runpy.py&quot;, line
   85, in _run_code
      exec(code, run_globals)
    File &quot;C:\Users\DELL\AppData\Local\Programs\Python\Python36\Scripts\pip.exe\__m
  ain__.py&quot;, line 7, in &lt;module&gt;
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_internal\cli\main.py&quot;, line 75, in main
      return command.main(cmd_args)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_internal\cli\base_command.py&quot;, line 121, in main
      return self._main(args)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\contextlib.py&quot;,
   line 89, in __exit__
      next(self.gen)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_internal\cli\command_context.py&quot;, line 28, in main_context
      yield
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\contextlib2.py&quot;, line 479, in __exit__
      _reraise_with_existing_context(exc_details)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\contextlib2.py&quot;, line 340, in _reraise_with_existing_context
      raise exc_details[1]
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\contextlib.py&quot;,
   line 100, in __exit__
      self.gen.throw(type, value, traceback)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_internal\utils\temp_dir.py&quot;, line 85, in tempdir_registry
      yield _tempdir_registry
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\contextlib2.py&quot;, line 468, in __exit__
      if cb(*exc_details):
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\contextlib2.py&quot;, line 396, in _exit_wrapper
      return cm_exit(cm, *exc_details)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\contextlib.py&quot;,
   line 89, in __exit__
      next(self.gen)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_internal\utils\temp_dir.py&quot;, line 46, in global_tempdir_manager
      _tempdir_manager = old_tempdir_manager
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\contextlib2.py&quot;, line 479, in __exit__
      _reraise_with_existing_context(exc_details)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\contextlib2.py&quot;, line 340, in _reraise_with_existing_context
      raise exc_details[1]
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\contextlib2.py&quot;, line 468, in __exit__
      if cb(*exc_details):
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\contextlib2.py&quot;, line 396, in _exit_wrapper
      return cm_exit(cm, *exc_details)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_internal\utils\temp_dir.py&quot;, line 175, in __exit__
      self.cleanup()
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_internal\utils\temp_dir.py&quot;, line 199, in cleanup
      rmtree(ensure_text(self._path))
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\retrying.py&quot;, line 49, in wrapped_f
      return Retrying(*dargs, **dkw).call(f, *args, **kw)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\retrying.py&quot;, line 212, in call
      raise attempt.get()
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\retrying.py&quot;, line 247, in get
      six.reraise(self.value[0], self.value[1], self.value[2])
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\six.py&quot;, line 703, in reraise
      raise value
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_vendor\retrying.py&quot;, line 200, in call
      attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p
  ip\_internal\utils\misc.py&quot;, line 139, in rmtree
      onerror=rmtree_errorhandler)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py&quot;, lin
  e 488, in rmtree
      return _rmtree_unsafe(path, onerror)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py&quot;, lin
  e 378, in _rmtree_unsafe
      _rmtree_unsafe(fullname, onerror)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py&quot;, lin
  e 378, in _rmtree_unsafe
      _rmtree_unsafe(fullname, onerror)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py&quot;, lin
  e 378, in _rmtree_unsafe
      _rmtree_unsafe(fullname, onerror)
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py&quot;, lin
  e 383, in _rmtree_unsafe
      onerror(os.unlink, fullname, sys.exc_info())
    File &quot;c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py&quot;, lin
  e 381, in _rmtree_unsafe
      os.unlink(fullname)
  PermissionError: [WinError 5] Access is denied: 'C:\\Users\\DELL\\AppData\\Local
  \\Temp\\pip-install-k22kzs5t\\pyinstaller\\PyInstaller\\bootloader\\Windows-32bi
  t\\run.exe'
  </code></pre>
  <p>This has been frustrating. I ran cmd with administrator too but other post aren't working for me. btw I have windows 7</p>