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
Related
I'm facing this error while installing face_recognition in a virtualenv with Python 3.8.10 on Ubuntu 20.04.
ERROR: Failed building wheel for face-recognition-models
Running setup.py clean for face-recognition-models
Failed to build dlib face-recognition-models
Installing collected packages: Click, numpy, dlib, face-recognition-models, face-recognition
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: '/home/badrelden/Desktop/test python sound/venv/bin/python3' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tai2snq9/dlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tai2snq9/dlib/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-bhy0sde6/install-record.txt --single-version-externally-managed --compile --install-headers '/home/badrelden/Desktop/test python sound/venv/include/site/python3.8/dlib'
cwd: /tmp/pip-install-tai2snq9/dlib/
Complete output (8 lines):
running install
running build
running build_py
package init file 'tools/python/dlib/__init__.py' not found (or not a regular file)
running build_ext
ERROR: CMake must be installed to build dlib
----------------------------------------
ERROR: Command errored out with exit status 1: '/home/badrelden/Desktop/test python sound/venv/bin/python3' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tai2snq9/dlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tai2snq9/dlib/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-bhy0sde6/install-record.txt --single-version-externally-managed --compile --install-headers '/home/badrelden/Desktop/test python sound/venv/include/site/python3.8/dlib' Check the logs for full command output.
ERROR: CMake must be installed to build dlib
This is the key part of the error message. You need to install cmake, which can be done by running sudo apt install cmake on Debian-based systems, including Ubuntu. After cmake is installed, you can rerun the pip install command.
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
python -m pip install dbus-python
Collecting dbus-python
Using cached dbus-python-1.2.16.tar.gz (576 kB)
Using legacy 'setup.py install' for dbus-python, since package 'wheel' is not installed.
Installing collected packages: dbus-python
Running setup.py install for dbus-python ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\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\pure8\AppData\Local\Temp\pip-record-l_6vpx3k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\Include\dbus-python'
cwd: C:\Users\pure8\AppData\Local\Temp\pip-install-zphzgd3p\dbus-python\
Complete output (5 lines):
running install
running build
creating C:\Users\pure8\AppData\Local\Temp\pip-install-zphzgd3p\dbus-python\build
creating C:\Users\pure8\AppData\Local\Temp\pip-install-zphzgd3p\dbus-python\build\temp.win-amd64-3.8
error: [WinError 193] %1 is not a valid Win32 application
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\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\pure8\AppData\Local\Temp\pip-record-l_6vpx3k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\Include\dbus-python' Check the logs for full command output.
every time I try to install dbus it gives me an error, I tried installing 32 bit and 64 bit of new python updates, and they are added to PATH, but that didn't help to install dbus. Dbus is required for notify2.
I had met the same problem.
Perhaps it's not recommended to use dbus-python on the Windows.
I just move the folder /usr/local/lib/python2.7/dist-packages/dbus (Linux) to the Python2.7 folder (Windows).
And I can see the dbus in the VScode by Ctrl + mouse(left).
On macOS I ran this command in Terminal:
sudo pip3 install face_recognition
It started installing and then threw this error:
ERROR: Command errored out with exit status 1:
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c
'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/private/tmp/pip-install-75ks5d9l/dlib/setup.py'"'"';
file='"'"'/private/tmp/pip-install-75ks5d9l/dlib/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
install --record /private/tmp/pip-record-bze0mci9/install-record.txt
--single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/dlib
Check the logs for full command output.
I read a suggestion about installing dlib first which also threw an error. How can I fix this?
First install cmake using following command:
pip3 install cmake
I am trying to install a package which needs psycopg2 as a dependency, so I installed psycopg2-binary using pip install psycopg2-binary but when I try to pip install django-tenant-schemas I get this error:
In file included from psycopg/psycopgmodule.c:27:0:
./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at <http://initd.org/psycopg/docs/install.html>).
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
ERROR: Command errored out with exit status 1:
/home/david/PycharmProjects/clearpath/venv/bin/python -u
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ckbbq00w/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ckbbq00w/psycopg2/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-pi6j7x5l/install-record.txt
--single-version-externally-managed
--compile
--install-headers /home/david/PycharmProjects/clearpath/venv/include/site/python3.7/psycopg2 Check the logs for full command output.
When I go into my projects (using PyCharm) repo settings I can see psycopg2-binary is installed. I assume this has something to do with the PATH but I can't seem to figure out how to solve the issue.
which psql: /usr/bin/psql
which pg_config: /usr/bin/pg_config
I am not comfortable doing much in the Environment variables as I really don't want to break something.
It seems that you try to install pscopg2, and it may cause problem if psycopg2-binary is already installed
Here are your logs on several lines:
ERROR: Command errored out with exit status 1:
/home/david/PycharmProjects/clearpath/venv/bin/python -u
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ckbbq00w/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ckbbq00w/psycopg2/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-pi6j7x5l/install-record.txt
--single-version-externally-managed
--compile
--install-headers /home/david/PycharmProjects/clearpath/venv/include/site/python3.7/psycopg2 Check the logs for full command output.
I would try to uninstall psycopg2-binary and then reinstall django-tenant-schemas
The issue seemed to be a bad install of libpq-fe-h that was fixed using a reinstall. Question was solved here