Command errored out with exit status 1 and access denied

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.

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 -- 'setuptools>=40.8.0' wheel cwd: None Complete output (14 lines): Traceback (most recent call last): File "c:\users\dell\appdata\local\programs\python\python36\lib\runpy.py", li ne 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\dell\appdata\local\programs\python\python36\lib\runpy.py", li ne 85, in _run_code exec(code, run_globals) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages \pip\__main__.py", line 23, in <module> from pip._internal.cli.main import main as _main # isort:skip # noqa File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages \pip\_internal\cli\main.py", line 5, in <module> import locale File "c:\users\dell\appdata\local\programs\python\python36\lib\locale.py", l ine 16, in <module> import re File "c:\users\dell\appdata\local\programs\python\python36\lib\re.py", line 142, in <module> 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 -- 's etuptools>=40.8.0' wheel Check the logs for full command output. Traceback (most recent call last): File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\contextlib2.py", line 468, in __exit__ if cb(*exc_details): File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\contextlib2.py", line 396, in _exit_wrapper return cm_exit(cm, *exc_details) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_internal\utils\temp_dir.py", line 175, in __exit__ self.cleanup() File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_internal\utils\temp_dir.py", line 199, in cleanup rmtree(ensure_text(self._path)) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\retrying.py", line 49, in wrapped_f return Retrying(*dargs, **dkw).call(f, *args, **kw) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\retrying.py", line 212, in call raise attempt.get() File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\retrying.py", line 247, in get six.reraise(self.value[0], self.value[1], self.value[2]) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\six.py", line 703, in reraise raise value File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\retrying.py", line 200, in call attempt = Attempt(fn(*args, **kwargs), attempt_number, False) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_internal\utils\misc.py", line 139, in rmtree onerror=rmtree_errorhandler) File "c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py", lin e 488, in rmtree return _rmtree_unsafe(path, onerror) File "c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py", lin e 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py", lin e 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py", lin e 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py", lin e 383, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py", 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 "c:\users\dell\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\dell\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\Scripts\pip.exe\__m ain__.py", line 7, in <module> File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_internal\cli\main.py", line 75, in main return command.main(cmd_args) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_internal\cli\base_command.py", line 121, in main return self._main(args) File "c:\users\dell\appdata\local\programs\python\python36\lib\contextlib.py", line 89, in __exit__ next(self.gen) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_internal\cli\command_context.py", line 28, in main_context yield File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\contextlib2.py", line 479, in __exit__ _reraise_with_existing_context(exc_details) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\contextlib2.py", line 340, in _reraise_with_existing_context raise exc_details[1] File "c:\users\dell\appdata\local\programs\python\python36\lib\contextlib.py", line 100, in __exit__ self.gen.throw(type, value, traceback) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_internal\utils\temp_dir.py", line 85, in tempdir_registry yield _tempdir_registry File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\contextlib2.py", line 468, in __exit__ if cb(*exc_details): File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\contextlib2.py", line 396, in _exit_wrapper return cm_exit(cm, *exc_details) File "c:\users\dell\appdata\local\programs\python\python36\lib\contextlib.py", line 89, in __exit__ next(self.gen) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_internal\utils\temp_dir.py", line 46, in global_tempdir_manager _tempdir_manager = old_tempdir_manager File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\contextlib2.py", line 479, in __exit__ _reraise_with_existing_context(exc_details) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\contextlib2.py", line 340, in _reraise_with_existing_context raise exc_details[1] File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\contextlib2.py", line 468, in __exit__ if cb(*exc_details): File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\contextlib2.py", line 396, in _exit_wrapper return cm_exit(cm, *exc_details) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_internal\utils\temp_dir.py", line 175, in __exit__ self.cleanup() File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_internal\utils\temp_dir.py", line 199, in cleanup rmtree(ensure_text(self._path)) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\retrying.py", line 49, in wrapped_f return Retrying(*dargs, **dkw).call(f, *args, **kw) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\retrying.py", line 212, in call raise attempt.get() File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\retrying.py", line 247, in get six.reraise(self.value[0], self.value[1], self.value[2]) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\six.py", line 703, in reraise raise value File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_vendor\retrying.py", line 200, in call attempt = Attempt(fn(*args, **kwargs), attempt_number, False) File "c:\users\dell\appdata\local\programs\python\python36\lib\site-packages\p ip\_internal\utils\misc.py", line 139, in rmtree onerror=rmtree_errorhandler) File "c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py", lin e 488, in rmtree return _rmtree_unsafe(path, onerror) File "c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py", lin e 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py", lin e 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py", lin e 378, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py", lin e 383, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "c:\users\dell\appdata\local\programs\python\python36\lib\shutil.py", 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' 

This has been frustrating. I ran cmd with administrator too but other post aren't working for me. btw I have windows 7

2 Answers

The error message - "PermissionError: [WinError 5] Access is denied: '... Windows-32bit\run.exe'" suggests that a 32-bit version file is being run, and hence is being denied access.

The problem may get solved by removing the existing version of Python from Windows and then installing the 64-bit version afresh.

Tip for successful installation and hassle-free upgrade:

Manually create the installation directory with small path, without spaces and with 'write' permissions for installing python, instead of the default one offered by the installer.

The installer installs to C:\users\name\app data\ ...... This path usually causes problems while upgrading Python.

Tip:

Create a folder named C:\python3 (for installing python v3) and give 'write' permission to it to the user.

Select C:\python3 as the installation directory during the installation.

This will help install python and also upgrade it without hassles in the future.

4

When I faced the error, I closed cmd. I started cmd with administrator and fired the command nvm use 12.10.0 and it worked for me.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like