1

When i try to do "pip install pyinstaller" I get this error (Python 39)

    ERROR: Command errored out with exit status 1:
     command: 'c:\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\kaito\\AppData\\Local\\Temp\\pip-install-x1uajlp_\\pefile\\setup.py'"'"'; __file__='"'"'C:\\Users\\kaito\\AppData\\Local\\Temp\\pip-install-x1uajlp_\\pefile\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\kaito\AppData\Local\Temp\pip-record-i794i3gc\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python39\Include\pefile'
         cwd: C:\Users\kaito\AppData\Local\Temp\pip-install-x1uajlp_\pefile\
    Complete output (14 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib
    copying pefile.py -> build\lib
    copying peutils.py -> build\lib
    creating build\lib\ordlookup
    copying ordlookup\oleaut32.py -> build\lib\ordlookup
    copying ordlookup\ws2_32.py -> build\lib\ordlookup
    copying ordlookup\__init__.py -> build\lib\ordlookup
    running install_lib
    byte-compiling c:\python39\Lib\site-packages\pefile.py to pefile.cpython-39.pyc
    error: [Errno 13] Permission denied: 'c:\\python39\\Lib\\site-packages\\__pycache__\\pefile.cpython-39.pyc.2747580017328'
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\kaito\\AppData\\Local\\Temp\\pip-install-x1uajlp_\\pefile\\setup.py'"'"'; __file__='"'"'C:\\Users\\kaito\\AppData\\Local\\Temp\\pip-install-x1uajlp_\\pefile\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\kaito\AppData\Local\Temp\pip-record-i794i3gc\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python39\Include\pefile' Check the logs for full command output.

I can't seem to fix this issue, please help!

Kaitoruu
  • 19
  • 1

3 Answers3

1

Well, error is clear, you don't have access to the folder that you are trying to install the pip package.

Use the command pip install --user pyinstaller

If that doesn't do the job:

Create a virtualenv and install the package in there:

  1. Open up a terminal.
  2. Go to your project folder using the command cd
  3. Create a virtual environment with the command virtualenv venv
  4. Activate the virtual environment with the command \venv\Scripts\activate.bat
  5. After activating the virtual environment, you have a virtual environment that you have permissions to create/edit/delete files. So, you can install the package in there with the command pip install pyinstaller

You may also want to check the file permissions by right clicking the folder in the path below.

c:\python39\Lib\site-packages\

Also there is a related post that you might want to check. It could give you an idea about what is wrong.

  • Can you add the error you get in here so I can understand what is wrong? Maybe you haven't installed virtualenv package yet? Have you tried to install the pyinstaller with the command pip install --user pyinstaller? – Berk Gaffaroğlu Mar 07 '21 at 00:28
  • After I did the command, I still can't use pyinstaller as a command. – Kaitoruu Mar 07 '21 at 00:33
0

Your error is:

error: [Errno 13] Permission denied:

This is probably because you are not an admin user on your computer. You can either switch to an admin account or run terminal/command prompt as an admin (right click on command prompt select "run as admin")

Yash
  • 391
  • 3
  • 14
0

Run cmd as Administrator. Select Yes in UAC window.