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
Related
This is the error i get. it was working fine before, then i reinstalled python(i have added it to the system variables) and installed vscode if thats relevant.but even with windows terminal i get the same error. I did download the c++ with tools, followed the link and downloaded and installed it.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\chaitali\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Chaitali\\AppData\\Local\\Temp\\pip-install-3h22t0nk\\twisted\\setup.py'"'"'; __file__='"'"'C:\\Users\\Chaitali\\AppData\\Local\\Temp\\pip-install-3h22t0nk\\twisted\\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\Chaitali\AppData\Local\Temp\pip-record-ttosnncb\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\chaitali\appdata\local\programs\python\python39\Include\Twisted' Check the logs for full command output.
Try to install Twisted manually:
Download your version from this Python Extension Packages website and install it using (if you have Python 3.9 and win32 platform):
pip3 install Twisted‑20.3.0‑cp39‑cp39‑win32.whl
After that you'll be able to install Scrapy using:
pip3 install scrapy
I was trying to install the python scikit-image library using pip on a Jetson Xavier, and I got an extremely long error message indicating that it had failed to build the wheel for the "imagecodecs" library. I tried to install imagecodecs by itself and received a similar error message.
After some looking around, I found this question, and the error is identical to my own. However, the solution of updating pip did not fix the issue.
Error Message:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-iu5szk39/imagecodecs/setup.py'"'"'; __file__='"'"'/tmp/pip-install-iu5szk39/imagecodecs/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-5h3fo15u
cwd: /tmp/pip-install-iu5szk39/imagecodecs/
...
At top level:
imagecodecs/_tiff.c:10261:47: warning: ‘__pyx_f_11imagecodecs_5_tiff_memtif_new’ defined but not used [-Wunused-function]
static __pyx_t_11imagecodecs_5_tiff_memtif_t *__pyx_f_11imagecodecs_5_tiff_memtif_new(toff_t __pyx_v_size, toff_t __pyx_v_inc) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for imagecodecs
Running setup.py clean for imagecodecs
Failed to build imagecodecs
Installing collected packages: imagecodecs
Running setup.py install for imagecodecs ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-iu5szk39/imagecodecs/setup.py'"'"'; __file__='"'"'/tmp/pip-install-iu5szk39/imagecodecs/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-ttclns6b/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/imagecodecs
cwd: /tmp/pip-install-iu5szk39/imagecodecs/
...
At top level:
imagecodecs/_tiff.c:10261:47: warning: ‘__pyx_f_11imagecodecs_5_tiff_memtif_new’ defined but not used [-Wunused-function]
static __pyx_t_11imagecodecs_5_tiff_memtif_t *__pyx_f_11imagecodecs_5_tiff_memtif_new(toff_t __pyx_v_size, toff_t __pyx_v_inc) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-iu5szk39/imagecodecs/setup.py'"'"'; __file__='"'"'/tmp/pip-install-iu5szk39/imagecodecs/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-ttclns6b/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/imagecodecs Check the logs for full command output.
Try upgrading pip using this command.
sudo -H pip3 install --upgrade pip
sudo -H pip2 install --upgrade pip
pip should now be on the latest version.
$ pip3 --version
pip 20.1.1 from ...
Then install using pip3
pip3 install scikit-image
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 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
When I install mysql-python using pip on mac os, I always get this error, how can I solve this problem?
ld: warning: directory not found for option '-L/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.Internal.sdk/usr/local/libressl/lib'
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-UEOYdV/mysql-python/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-UEOYdV/mysql-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 /private/tmp/pip-record-EgQ8P0/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Try:
pip install --upgrade setuptools
As AMC posted in a comment, this error can occur when using the builtin MacOS Python 2. Use a tool like pyenv to install a standard Python distribution, create a virtual environment, and try again.