gcc error while installing psycopg2 on RHEL 7 VM - python

My environment in RHEL 7, Python 3.6 and Postgres is located on RDS cluster.
I am using Pycharm to develop. I did
python -m pip install psycopg2 it gives error
command gcc failed with exit status 1
To rectify, I tried to install psycopg2-binary but I need psycopg2 package to connect to postgres through python script. If I use SQLAlchemy, it directs through the psycopg2 package.
I tried sudo yum install postgresql-libs .... sudo yum install postgresql-devel but the problem persists.
Here's the full error in a picture:
Full error:
[priya#localhost psycopg2-2.9.1]$ pip install psycopg2
Defaulting to user installation because normal site-packages is not writeable
Collecting psycopg2
Using cached psycopg2-2.9.1.tar.gz (379 kB)
Using legacy 'setup.py install' for psycopg2, since package 'wheel' is not installed.
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oe9qfnfj/psycopg2_0348a9316a144cb3bcfec63fc1fb2743/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oe9qfnfj/psycopg2_0348a9316a144cb3bcfec63fc1fb2743/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-2rdr62wb/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/priya/.local/include/python3.6m/psycopg2
cwd: /tmp/pip-install-oe9qfnfj/psycopg2_0348a9316a144cb3bcfec63fc1fb2743/
Complete output (38 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/psycopg
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSYCOPG_VERSION=2.9.1 (dt dec pq3 ext) -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=90224 -DPSYCOPG_DEBUG=1 -I/usr/include/python3.6m -I. -I/usr/include -I/usr/include/pgsql/server -I/usr/include/libxml2 -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:28:0:
./psycopg/psycopg.h:35:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
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
<https://www.psycopg.org/docs/install.html>).
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oe9qfnfj/psycopg2_0348a9316a144cb3bcfec63fc1fb2743/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oe9qfnfj/psycopg2_0348a9316a144cb3bcfec63fc1fb2743/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-2rdr62wb/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/priya/.local/include/python3.6m/psycopg2 Check the logs for full command output.

Solution:
sudo yum repo-pkgs rhel-7-server-optional-rpms list | grep python3
sudo yum install python3-devel.x86_64 --enablerepo=rhel-7-server-optional-rpms
pip install psycopg2
Courtesy: Jonathan's answer from How to install python3-devel on red hat 7

Related

(python) Error while installing psycopg2 Ubuntu 20.04

I need to use psycopg2 package in python, Im trying to install it but I keep getting an error message while doing it. Not sure what the problem is since I've already installed pip.
This is the command I'm trying to run:
(venv) daniel#daniel-G5-5587:~/PycharmProjects/MIA_practica1$ pip3 install psycopg2
Any ideas? I'm attempting to Connect to PostgreSQL from Python.
I'm using Pycharm.
The error message I get is the following:
Collecting psycopg2
Using cached psycopg2-2.9.1.tar.gz (379 kB)
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/daniel/PycharmProjects/MIA_Practica1/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-x4wdi5s2/psycopg2_88a40f4af9bf4ada932e1b3b5ce407f1/setup.py'"'"'; __file__='"'"'/tmp/pip-install-x4wdi5s2/psycopg2_88a40f4af9bf4ada932e1b3b5ce407f1/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-pqnxooo7
cwd: /tmp/pip-install-x4wdi5s2/psycopg2_88a40f4af9bf4ada932e1b3b5ce407f1/
Complete output (38 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/psycopg
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.9.1 (dt dec pq3 ext lo64) -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=120008 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/home/daniel/PycharmProjects/MIA_Practica1/venv/include -I/usr/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -I/usr/include/libxml2 -I/usr/include/mit-krb5 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_asis.o -Wdeclaration-after-statement
In file included from psycopg/adapter_asis.c:28:
./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
35 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
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
<https://www.psycopg.org/docs/install.html>).
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /home/daniel/PycharmProjects/MIA_Practica1/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-x4wdi5s2/psycopg2_88a40f4af9bf4ada932e1b3b5ce407f1/setup.py'"'"'; __file__='"'"'/tmp/pip-install-x4wdi5s2/psycopg2_88a40f4af9bf4ada932e1b3b5ce407f1/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-dg3pm2ke/install-record.txt --single-version-externally-managed --compile --install-headers /home/daniel/PycharmProjects/MIA_Practica1/venv/include/site/python3.9/psycopg2
cwd: /tmp/pip-install-x4wdi5s2/psycopg2_88a40f4af9bf4ada932e1b3b5ce407f1/
Complete output (38 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.9/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/psycopg
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.9.1 (dt dec pq3 ext lo64) -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=120008 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/home/daniel/PycharmProjects/MIA_Practica1/venv/include -I/usr/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -I/usr/include/libxml2 -I/usr/include/mit-krb5 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_asis.o -Wdeclaration-after-statement
In file included from psycopg/adapter_asis.c:28:
./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
35 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
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
<https://www.psycopg.org/docs/install.html>).
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/daniel/PycharmProjects/MIA_Practica1/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-x4wdi5s2/psycopg2_88a40f4af9bf4ada932e1b3b5ce407f1/setup.py'"'"'; __file__='"'"'/tmp/pip-install-x4wdi5s2/psycopg2_88a40f4af9bf4ada932e1b3b5ce407f1/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-dg3pm2ke/install-record.txt --single-version-externally-managed --compile --install-headers /home/daniel/PycharmProjects/MIA_Practica1/venv/include/site/python3.9/psycopg2 Check the logs for full command output.
WARNING: You are using pip version 21.1.2; however, version 21.2.4 is available.
You should consider upgrading via the '/home/daniel/PycharmProjects/MIA_Practica1/venv/bin/python -m pip install --upgrade pip' command.

unable to install psycopg2 due to large error

I'm trying to install psycopg2 but I keep getting this error:
Collecting psycopg2
Using cached psycopg2-2.8.5.tar.gz (380 kB)
Using legacy setup.py install for psycopg2, since package 'wheel' is not installed.
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /home/yovel/PycharmProjects/scr/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8vyzoc4h/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8vyzoc4h/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-fq16err7/install-record.txt --single-version-externally-managed --compile --install-headers /home/yovel/PycharmProjects/scr/venv/include/site/python3.8/psycopg2
cwd: /tmp/pip-install-8vyzoc4h/psycopg2/
Complete output (40 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/compat.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.8/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/psycopg
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.5 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120002 -DHAVE_LO64=1 -I/home/yovel/PycharmProjects/scr/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.8/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:28:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
36 | #include <libpq-fe.h>
| ^~~~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
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
<https://www.psycopg.org/docs/install.html>).
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/yovel/PycharmProjects/scr/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8vyzoc4h/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8vyzoc4h/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-fq16err7/install-record.txt --single-version-externally-managed --compile --install-headers /home/yovel/PycharmProjects/scr/venv/include/site/python3.8/psycopg2 Check the logs for full command output.
I can install and use it using psycopg2-binary but I need to install this because it's a dependency (for django-heroku).
I tried installing libpq-dev but got this error:
The following packages have unmet dependencies:
libpq-dev : Depends: libpq5 (= 12.2-4) but 12.3-1.pgdg20.04+1 is to be installed
E: Unable to correct problems, you have held broken packages
and using sudo apt-get install libpq5
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.

Compile errors installing REGEX in MacOS [duplicate]

This question already has an answer here:
Error on "pip install -U channels" command using for otree (Running setup.py bdist_wheel for twisted ... error)
(1 answer)
Closed 2 years ago.
I'm trying to install Regex on macos catalina, but I'm getting this error, how do I proceed? I tried to update pip, pip3, pipwin, xcode, but both return the same error, the same happens when I install NLTK.
I was able to install on a ubuntu VM and installed everything, REGEX and NLTK, only on MacOs that I continue with this error below:
pip3 install regex
Collecting regex
Using cached regex-2020.6.8.tar.gz (690 kB)
Building wheels for collected packages: regex
Building wheel for regex (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/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 /private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-wheel-j6dr4ocd
cwd: /private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/
Complete output (17 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/regex.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/_regex_core.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/test_regex.py -> build/lib.macosx-10.14-x86_64-3.7/regex
running build_ext
building 'regex._regex' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/regex_3
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.14-x86_64-3.7/regex_3/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for regex
Running setup.py clean for regex
Failed to build regex
Installing collected packages: regex
Running setup.py install for regex ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/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/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-record-olfcxoeu/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/regex
cwd: /private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/regex.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/_regex_core.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/test_regex.py -> build/lib.macosx-10.14-x86_64-3.7/regex
running build_ext
building 'regex._regex' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/regex_3
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.14-x86_64-3.7/regex_3/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/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/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-record-olfcxoeu/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/regex Check the logs for full command output.**strong text**
I am no mac super user but you could try this and check if it works.
xcode-select --install
If it says it's already installed try:
xcode-select --reset
The reason I believe it might be the issue is cause of the xcrun error that is occurring.
The underlying error seems to be:
invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun`
You can most likely solve this by installing the command line tools:
xcode-select --install
See https://apple.stackexchange.com/questions/254380/why-am-i-getting-an-invalid-active-developer-path-when-attempting-to-use-git-a for more details.

Can't install binance package through pip install [duplicate]

This question already has an answer here:
Error on "pip install -U channels" command using for otree (Running setup.py bdist_wheel for twisted ... error)
(1 answer)
Closed 2 years ago.
I am trying to install binance package with pip in my Jupyter notebook by writing pip install python-binance
and facing this error
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/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 /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-wheel-ivmvv_y7
cwd: /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/
Complete output (17 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/_regex_core.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/test_regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
running build_ext
building 'regex._regex' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/regex_3
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.9-x86_64-3.7/regex_3/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for regex
Running setup.py clean for regex
Failed to build regex
Installing collected packages: regex, dateparser, python-binance
Running setup.py install for regex ... error
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/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/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-record-fasv8uk1/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/include/python3.7m/regex
cwd: /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/_regex_core.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/test_regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
running build_ext
building 'regex._regex' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/regex_3
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.9-x86_64-3.7/regex_3/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/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/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-record-fasv8uk1/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/include/python3.7m/regex Check the logs for full command output
I have tried solutions from other stackoverflow questions, but nothing worked for me. I also have recently upgraded my macOS to Catalina 10.15.5.
Thank you in advance
Here is the error crashing you pip installer :
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
This error is caused while upgrading your macOS. This line in your console should do the trick.
xcode-select -–install
if this does not work you will need a reset :
sudo xcode-select --reset

Can't install sasl package in Ubuntu 18

I want to install pyHive package in ubuntu. Using this step:-
sudo apt-get install gcc
sudo apt-get install libsasl2-dev
pip install sasl
pip install thrift
pip install thrift-sasl
pip install PyHive
but when i install sasl package it's given me error
Using cached sasl-0.2.1.tar.gz (30 kB)
Requirement already satisfied: six in /home/shivam_gupta/Documents/pip3-venv/lib/python3.7/site-packages (from sasl) (1.14.0)
Installing collected packages: sasl
Running setup.py install for sasl ... error
ERROR: Command errored out with exit status 1:
command: /home/shivam_gupta/Documents/pip3-venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vokx0cvb/sasl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vokx0cvb/sasl/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-hqi5nw58/install-record.txt --single-version-externally-managed --compile --install-headers /home/shivam_gupta/Documents/pip3-venv/include/site/python3.7/sasl
cwd: /tmp/pip-install-vokx0cvb/sasl/
Complete output (32 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/sasl
copying sasl/__init__.py -> build/lib.linux-x86_64-3.7/sasl
running egg_info
writing sasl.egg-info/PKG-INFO
writing dependency_links to sasl.egg-info/dependency_links.txt
writing requirements to sasl.egg-info/requires.txt
writing top-level names to sasl.egg-info/top_level.txt
reading manifest file 'sasl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'sasl.egg-info/SOURCES.txt'
copying sasl/saslwrapper.cpp -> build/lib.linux-x86_64-3.7/sasl
copying sasl/saslwrapper.h -> build/lib.linux-x86_64-3.7/sasl
copying sasl/saslwrapper.pyx -> build/lib.linux-x86_64-3.7/sasl
running build_ext
building 'sasl.saslwrapper' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/sasl
gcc -pthread -B /home/shivam_gupta/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/home/shivam_gupta/Documents/pip3-venv/include -I/home/shivam_gupta/anaconda3/include/python3.7m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.7/sasl/saslwrapper.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from sasl/saslwrapper.cpp:254:0:
sasl/saslwrapper.h: In member function ‘void saslwrapper::ClientImpl::interact(sasl_interact_t*)’:
sasl/saslwrapper.h:437:11: warning: unused variable ‘input’ [-Wunused-variable]
char* input;
^~~~~
g++ -pthread -shared -B /home/shivam_gupta/anaconda3/compiler_compat -L/home/shivam_gupta/anaconda3/lib -Wl,-rpath=/home/shivam_gupta/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/sasl/saslwrapper.o -lsasl2 -o build/lib.linux-x86_64-3.7/sasl/saslwrapper.cpython-37m-x86_64-linux-gnu.so
unable to execute 'g++': No such file or directory
error: command 'g++' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/shivam_gupta/Documents/pip3-venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vokx0cvb/sasl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vokx0cvb/sasl/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-hqi5nw58/install-record.txt --single-version-externally-managed --compile --install-headers /home/shivam_gupta/Documents/pip3-venv/include/site/python3.7/sasl Check the logs for full command output.
My python version:- 3.7.6
What I do for installing hive in my ubuntu system?
And thrift-sasl also not installed.
unable to execute 'g++': No such file or directory
You don't have GNU C++ compiler. Install it:
sudo apt-get install g++

Categories

Resources