I can't install Pyinstaller - python

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!

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:
Open up a terminal.
Go to your project folder using the command cd
Create a virtual environment with the command virtualenv venv
Activate the virtual environment with the command \venv\Scripts\activate.bat
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.

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")

Run cmd as Administrator. Select Yes in UAC window.

Related

How do I fix this error when installing pyPDF2 in Python

I receive the following error when trying to install pyPDF2 using following text at the command prompt:
python -m pip install pyPDF2
Any suggestions to resolve?
Error result:
Microsoft Windows [Version 10.0.19042.572]
(c) 2020 Microsoft Corporation. All rights reserved.
C:\Users\bell_>python -m pip install pyPDF2
Collecting pyPDF2
Using cached https://files.pythonhosted.org/packages/b4/01/68fcc0d43daf4c6bdbc6b33cc3f77bda531c86b174cac56ef0ffdb96faab/PyPDF2-1.26.0.tar.gz
Installing collected packages: pyPDF2
Running setup.py install for pyPDF2 ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\bell_\\AppData\\Local\\Temp\\pip-install-q3y1fs2o\\pyPDF2\\setup.py'"'"'; __file__='"'"'C:\\Users\\bell_\\AppData\\Local\\Temp\\pip-install-q3y1fs2o\\pyPDF2\\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\bell_\AppData\Local\Temp\pip-record-4uxjshye\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\bell_\AppData\Local\Temp\pip-install-q3y1fs2o\pyPDF2\
Complete output (18 lines):
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\PyPDF2
copying PyPDF2\filters.py -> build\lib\PyPDF2
copying PyPDF2\generic.py -> build\lib\PyPDF2
copying PyPDF2\merger.py -> build\lib\PyPDF2
copying PyPDF2\pagerange.py -> build\lib\PyPDF2
copying PyPDF2\pdf.py -> build\lib\PyPDF2
copying PyPDF2\utils.py -> build\lib\PyPDF2
copying PyPDF2\xmp.py -> build\lib\PyPDF2
copying PyPDF2\_version.py -> build\lib\PyPDF2
copying PyPDF2\__init__.py -> build\lib\PyPDF2
running install_lib
creating C:\Program Files\Python38\Lib\site-packages\PyPDF2
error: could not create 'C:\Program Files\Python38\Lib\site-packages\PyPDF2': Access is denied
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\bell_\\AppData\\Local\\Temp\\pip-install-q3y1fs2o\\pyPDF2\\setup.py'"'"'; __file__='"'"'C:\\Users\\bell_\\AppData\\Local\\Temp\\pip-install-q3y1fs2o\\pyPDF2\\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\bell_\AppData\Local\Temp\pip-record-4uxjshye\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.2.4 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
In your error it says that access was denied. So try running the same command while running cmd as admin.

pip install trains fails

upon running pip install trains in my virtual env
I am getting
ERROR: Command errored out with exit status 1:
command: /home/epdadmin/noam/code/venv_linux/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-owzh8lnl/retrying/setup.py'"'"'; __file__='"'"'/tmp/pip-install-owzh8lnl/retrying/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lxz5t8pu/install-record.txt --single-version-externally-managed --compile --install-headers /home/epdadmin/noam/code/venv_linux/include/site/python3.8/retrying
cwd: /tmp/pip-install-owzh8lnl/retrying/
Complete output (10 lines):
running install
running build
running build_py
creating build
creating build/lib
copying retrying.py -> build/lib
running install_lib
copying build/lib/retrying.py -> /home/epdadmin/noam/code/venv_linux/lib/python3.8/site-packages
byte-compiling /home/epdadmin/noam/code/venv_linux/lib/python3.8/site-packages/retrying.py to retrying.cpython-38.pyc
error: [Errno 13] Permission denied: '/home/epdadmin/noam/code/venv_linux/lib/python3.8/site-packages/__pycache__/retrying.cpython-38.pyc.139678407381360'
----------------------------------------
ERROR: Command errored out with exit status 1: /home/epdadmin/noam/code/venv_linux/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-owzh8lnl/retrying/setup.py'"'"'; __file__='"'"'/tmp/pip-install-owzh8lnl/retrying/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lxz5t8pu/install-record.txt --single-version-externally-managed --compile --install-headers /home/epdadmin/noam/code/venv_linux/include/site/python3.8/retrying Check the logs for full command output.
I know that I am not supposed to run under sudo when using a venv, so I don't really understand the problem
running for example pip install pandas does work.
Python 3.8
How to install trains?
EDIT:
running pip install trains --user or pip install --user trains gives
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
You have two options:
Create a virtual environment and install your packages inside it (preferred)
Install your packages inside your user home directory by passing --user flag
pip install --user
The problem was a permissions problem for the venv.
Another problem was trains required some packages that were not yet available with wheels on Python3.8, so I had to downgrade Python to 3.7
That venv was created using Pycharm, and for some reason it was created with low permissions.
There was probably a way to elevate its permissions, but instead I just deleted it and created another one using command line by
python -m virtualenv --python=/usr/bin/python3.7 venv
And now pip install trains worked.
Very annoying.
I had the same error with installing matplotlib in Ubuntu 18.
Running these lines worked for me:
sudo apt-get install python3-dev
apt-get install build-essential
As found on setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Why does installing xlwings over the terminal produce an error?

I am relatively new to Python and I am just doing a private project right now. For that I want to install xlwing to be able to run a python code from Excel. However it seems I can not install it. I try to install via:
C:\Users\Rafi>python -m pip install --user xlwings
as I installed all my other stuff.
Now when I put that into the terminal it shows me the (long) error following. However, I cant find a solution, whatever I try, maybe you guys have some suggestions?
***Running setup.py install for comtypes ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\Rafi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\setup.py'"'"'; __file='"'"'C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\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\Rafi\AppData\Local\Temp\pip-record-qtr4pqm3\install-record.txt' --single-version-externally-managed --compile --user --prefix= cwd: C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\ Complete output (276 lines): running install running build running build_py creating build creating build\lib creating build\lib\comtypes copying comtypes\automation.py -> build\lib\comtypes copying comtypes\connectionpoints.py -> build\lib\comtypes copying<br/>
.<br/>
.<br/>
.<br/>
error: error in setup script: command 'bdist_wininst' has no such option 'install_script'
ERROR: Command errored out with exit status 1: 'C:\Users\Rafi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\setup.py'"'"'; _file='"'"'C:\Users\Rafi\AppData\Local\Temp\pip-install-xfdrq0ph\comtypes\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\Rafi\AppData\Local\Temp\pip-record-qtr4pqm3\install-record.txt' --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.
***
This error comes from installing a dependency of xlwings: comtypes.
A quick google search revealed that your issue could be caused by an old version of wheels. Upgrade wheels like this and try again:
pip install --upgrade wheel

CMD is not installing my packages using pip

Having errors on cmd as admin trying to install new modules even re-installed python to get newest version, and keeps failing!
Modules I have tried
pip install pyaudio
pip install smtplib
AND MANY Others
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\program files (x86)\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\marcu\\AppData\\Local\\Temp\\pip-install-9lkkindd\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\marcu\\AppData\\Local\\Temp\\pip-install-9lkkindd\\pyaudio\\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\marcu\AppData\Local\Temp\pip-record-dwdolxb5\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\marcu\AppData\Local\Temp\pip-install-9lkkindd\pyaudio\
Complete output (9 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files (x86)\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\marcu\\AppData\\Local\\Temp\\pip-install-9lkkindd\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\marcu\\AppData\\Local\\Temp\\pip-install-9lkkindd\\pyaudio\\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\marcu\AppData\Local\Temp\pip-record-dwdolxb5\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
yes you must download visual c++ 14 on microsoft website(optionnal) before! try after install
update your pip also!
try this link https://www.techspot.com/downloads/6776-visual-c-redistributable-package.html

Error when installing turicreate [duplicate]

This question already has answers here:
pip install failing with: OSError: [Errno 13] Permission denied on directory
(9 answers)
Closed 5 years ago.
I'm trying to install a package called turicreate on my device. I want to use it in code written in python 2.7
I have both python 3.6 and python 2.7 on my device so I'm trying to use the command:
$ python2.7 -m pip install turicreate
and then I get this error:
Running setup.py install for prettytable ... error
Complete output from command /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/4d/3qphp3b56cjdhdqh3jcv994r0000gn/T/pip-build-Uya2Ub/prettytable/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/4d/3qphp3b56cjdhdqh3jcv994r0000gn/T/pip-3wU21B-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
copying prettytable.py -> build/lib
running install_lib
copying build/lib/prettytable.py -> /Library/Python/2.7/site-packages
error: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/prettytable.py'
----------------------------------------
Command "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/4d/3qphp3b56cjdhdqh3jcv994r0000gn/T/pip-build-Uya2Ub/prettytable/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/4d/3qphp3b56cjdhdqh3jcv994r0000gn/T/pip-3wU21B-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/4d/3qphp3b56cjdhdqh3jcv994r0000gn/T/pip-build-Uya2Ub/prettytable/
Could someone please propose a solution to this issue?
Thanks,
Abe
PS: I'm on Mac and doing this in terminal.
This error means that you do not have administrator permissions to write in the dictionary. In order to gain this permission you need to use the sudo prefix.
sudo python2.7 -m pip install turicreate

Categories

Resources