I download a not commonly-used software package in github in Mac M1. I am trying to compile and install myself according to the instruction.
I have encountered the following problem saying "command/usr/bin/clang with exits error 1". I did install xcode in my mac. Because the built-in gcc version is 4.2, I upgrade the version using brew install gcc#7 command and the link to this gcc version. But I still face the same compiling problem.
Does anyone have instructions for me how to solve this? The author did not maintain the source code anymore and I have struggled for one day and still can not fix the problem.
The follow steps worked!
upgrade pip and related components by:
python -m pip install --upgrade pip
pip install –upgrade wheel
pip install –upgrade setuptools
install openssl
brew install openssl re2
reinstall your package with some environment to be set
LDFLAGS="-L$(/opt/homebrew/bin/brew --prefix openssl)/lib -L$(/opt/homebrew/bin/brew --prefix re2)/lib" CPPFLAGS="-I$(/opt/homebrew/bin/brew --prefix openssl)/include -I$(/opt/homebrew/bin/brew --prefix re2)/include" GRPC_BUILD_WITH_BORING_SSL_ASM="" GRPC_PYTHON_BUILD_SYSTEM_RE2=true GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true GRPC_PYTHON_BUILD_SYSTEM_ZLIB=true pip install <your package name>
Source: https://candid.technology/error-command-usr-bin-clang-failed-with-exit-code-1/
I'm trying to install psycopg2 but
pip install psycopg2 brings to error: command 'gcc' failed with exit status 1
Command line tools are installed
MacOS 10.15
This is likely because you don't have the PostgreSQL devel library installed. You have a few options:
(1) Install the binary with pip install psycopg2-binary
(2) Install PostgreSQL with HomeBrew: brew install postgresql, then pip install psycopg2.
You can probably just install the binary.
after updating the pip package error went away
To Update python3 pip package
wget https://bootstrap.pypa.io/get-pip.py
/usr/bin/python3 get-pip.py
I'm trying to run this in Terminal:
pip install pyquil
But then this error comes up:
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/zv/vwwhcqfs4xj_9b09bbs1c3cm0000gn/T/pip-build-8VPMQz/pyquil/
I've read through many other threads with the same problem and tried some solutions, but still no luck.
Attempted Solutions:
Add this to bash profile:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
Updating pip/setuptools
Using ez_setup
I'm trying to follow this, and have the prerequisites: http://pyquil.readthedocs.io/en/latest/start.html
Any ideas?
Try upgrading your pip & pip setup tools and then try,
sudo pip install pyobjc-core
sudo pip install pyobjc
sudo pip install --upgrade pip
sudo pip install --upgrade setuptools
Then
sudo pip install pyquil
use ubuntu virtualenv. I try to install reportlab
the command is
pip install reportlab
in this directory
(company2)stefano#stefano-X550EP:~/htdocs/company2$
the error is
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
actually the pip list is:
argparse (1.2.1)
Django (1.7.7)
html5lib (0.999)
pip (1.5.4)
pisa (3.0.33)
PyPDF2 (1.24)
setuptools (2.2)
wsgiref (0.1.2)
xhtml2pdf (0.0.6)
I need reportlab to use xhtml2pdf because now the django project gives me this error:
No module named reportlab.lib.colors
without your full error log, it is impossible to tell. But I bet you are just missing python-dev.
try installing it:
$ sudo apt-get install python-dev
then pip install reportlab again.
hope that helps.
see: installing Reportlab (error: command 'gcc' failed with exit status 1 )
The sudo apt-get install python-dev is almost correct. But if you are using Python 3.x you need to change it to install python3-dev. This made all the difference in my django, postgresql, venv setup.
I was also having the same issue while installing readability-lxml a python package. Then I tried installing following packages, and it worked for me.
sudo apt install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev
It majorly depends on the type of packages you suppose to install. Frequently its failing due to the missing of libsasl2-dev a package for authentication abstraction library which uses in the Ubuntu version
First, install:
sudo apt-get install libsasl2-dev
then run:
sudo pip install sasl
I know I am late. But after searching all over this is what solved mine. It need c++ compiler for reportlab. Try Installing g++, the c++ compiler
sudo apt install g++
I wanted to install eventlet on my system in order to have "Herd" for software deployment.. but the terminal is showing a gcc error:
root#agrover-OptiPlex-780:~# easy_install -U eventlet
Searching for eventlet
Reading http://pypi.python.org/simple/eventlet/
Reading http://wiki.secondlife.com/wiki/Eventlet
Reading http://eventlet.net
Best match: eventlet 0.9.16
Processing eventlet-0.9.16-py2.7.egg
eventlet 0.9.16 is already the active version in easy-install.pth
Using /usr/local/lib/python2.7/dist-packages/eventlet-0.9.16-py2.7.egg
Processing dependencies for eventlet
Searching for greenlet>=0.3
Reading http://pypi.python.org/simple/greenlet/
Reading https://github.com/python-greenlet/greenlet
Reading http://bitbucket.org/ambroff/greenlet
Best match: greenlet 0.3.4
Downloading http://pypi.python.org/packages/source/g/greenlet/greenlet- 0.3.4.zip#md5=530a69acebbb0d66eb5abd83523d8272
Processing greenlet-0.3.4.zip
Writing /tmp/easy_install-_aeHYm/greenlet-0.3.4/setup.cfg
Running greenlet-0.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_aeHYm/greenlet-0.3.4/egg-dist-tmp-t9_gbW
In file included from greenlet.c:5:0:
greenlet.h:8:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1`
Why can't Python.h be found?
Your install is failing because you don't have the python development headers installed. You can do this through apt on ubuntu/debian with:
sudo apt-get install python-dev
for python3 use:
sudo apt-get install python3-dev
For eventlet you might also need the libevent libraries installed so if you get an error talking about that you can install libevent with:
sudo apt-get install libevent-dev
For Fedora:
sudo yum install python-devel
sudo yum install libevent-devel
and finally:
sudo easy_install gevent
What worked for me on CentOS was:
sudo yum -y install gcc
sudo yum install python-devel
For Redhat Versions(Centos 7) Use the below command to install Python Development Package
Python 2.7
sudo yum install python-dev
Python 3.4
sudo yum install python34-devel
Python 3.6
sudo yum install python36-devel
If the issue is still not resolved then try installing the below packages -
sudo yum install python-devel
sudo yum install openssl-devel
sudo yum install libffi-devel
On MacOS I had trouble installing fbprophet which requires pystan which requires gcc to compile. I would consistently get the same error: command 'gcc' failed with exit status 1
I think I fixed the problem for myself thus:
I used brew install gcc to install the newest version, which ended up being gcc-8
Then I made sure that when gcc ran it would use gcc-8 instead.
It either worked because I added alias gcc='gcc-8 in my .zshrc (same as .bashrc but for zsh), or because I ran export PATH=/usr/local/bin:$PATH (see comment)
Also: all my attempts were inside a virtual environment and I only succeeded by installing fbprophet globally (with pip), but still no success inside a venv
This is an old post but I just run to the same problem on AWS EC2 installing regex. This working perfectly for me
sudo yum -y install gcc
and next
sudo yum -y install gcc-c++
If it is still not working, you can try this
sudo apt-get install build-essential
in my case, it solved the problem.
try this :
sudo apt-get install libblas-dev libatlas-base-dev
I had a similar issue on Ubuntu 14.04. For me the following Ubuntu packages
On MacOS I also had problems trying to install fbprophet which had gcc as one of its dependencies.
After trying several steps as recommended by #Boris the command below from the Facebook Prophet project page worked for me in the end.
conda install -c conda-forge fbprophet
It installed all the needed dependencies for fbprophet. Make sure you have anaconda installed.
This page is gonna save your life, for all further lib issues that are forthcoming,
For Alpine(>=3.6), use
apk --update --upgrade add gcc musl-dev jpeg-dev zlib-dev libffi-dev cairo-dev pango-dev gdk-pixbuf-dev
For CentOS 7.2:
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.2.1511 (Core)
Release: 7.2.1511
Codename: Core
Install eventlet:
sudo yum install python-devel
sudo easy_install -ZU eventlet
Terminal info:
[root#localhost ~]# easy_install -ZU eventlet
Searching for eventlet
Reading http://pypi.python.org/simple/eventlet/
Best match: eventlet 0.19.0
Downloading https://pypi.python.org/packages/5a/e8/ac80f330a80c18113df0f4f872fb741974ad2179f8c2a5e3e45f40214cef/eventlet-0.19.0.tar.gz#md5=fde857181347d5b7b921541367a99204
Processing eventlet-0.19.0.tar.gz
Running eventlet-0.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Hh9GQY/eventlet-0.19.0/egg-dist-tmp-rBFoAx
Adding eventlet 0.19.0 to easy-install.pth file
Installed /usr/lib/python2.6/site-packages/eventlet-0.19.0-py2.6.egg
Processing dependencies for eventlet
Finished processing dependencies for eventlet
For openSUSE 42.1 Leap Linux use this
sudo zypper install python3-devel
I am using MacOS catalina 10.15.4. None of the posted solutions worked for me. What worked for me is:
>> xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
>> env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2==2.8.4
Collecting psycopg2==2.8.4
Using cached psycopg2-2.8.4.tar.gz (377 kB)
Installing collected packages: psycopg2
Attempting uninstall: psycopg2
Found existing installation: psycopg2 2.7.7
Uninstalling psycopg2-2.7.7:
Successfully uninstalled psycopg2-2.7.7
Running setup.py install for psycopg2 ... done
Successfully installed psycopg2-2.8.4
use pip3 for python3
if you are on Mac as myself, try this in your terminal: xcode-select --install
Then accept the installation request, and it works afterwards as described in this issue
Build from source and install, this is fixed in the latest release (10.3+):
mkdir -p /tmp/install/netifaces/
cd /tmp/install/netifaces && wget -O "netifaces-0.10.4.tar.gz" "https://pypi.python.org/packages/source/n/netifaces/netifaces-0.10.4.tar.gz#md5=36da76e2cfadd24cc7510c2c0012eb1e"
tar xvzf netifaces-0.10.4.tar.gz
cd netifaces-0.10.4 && python setup.py install
Similarly I fixed it like this (notice python34):
sudo yum install python34-devel
sudo apt install gcc
It works for PyCharm on Ubuntu 20.10.
If you are migrating to a more modern version of python3 e.g. python3.5 to python3.8 You may want to check/upgrade the versions of the library that are failing if you have already installed the recommended libraries to handle gcc building python3-dev + other libraries as suggested.
It depends on the package. Some versions of the packages may not be supported on later versions of python3.