I’m trying to install lxml package on CentOS using sudo pip install lxml and its throwing this error right at the end:
error:
error: command 'gcc' failed with exit status 1
---------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/lxml/setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-PjviBq-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/lxml
Storing complete log in /root/.pip/pip.log
[hg@user-centos-1 ~]$ error: command 'gcc' failed with exit status 1
bash: error:: command not found
DennisLi
3,8155 gold badges27 silver badges59 bronze badges
asked Nov 13, 2013 at 14:02
Simple-SolutionSimple-Solution
4,17112 gold badges45 silver badges65 bronze badges
1
» error: command ‘gcc’ failed with exit status 1 «. the installation failed because of missing python-devel and some dependencies.
the best way to correct gcc problem:
You need to reinstall gcc , gcc-c++ and dependencies.
For python 2.7
$ sudo yum -y install gcc gcc-c++ kernel-devel
$ sudo yum -y install python-devel libxslt-devel libffi-devel openssl-devel
$ pip install "your python packet"
For python 3.4
$ sudo apt-get install python3-dev
$ pip install "your python packet"
Hope this will help.
answered Apr 30, 2016 at 4:51
2
Is gcc installed?
sudo yum install gcc
answered Nov 13, 2013 at 14:07
Alex HarveyAlex Harvey
5825 silver badges7 bronze badges
3
I bet you have to install libxml2-devel or libxml++-devel or even python-devel. But it is only a wild guess, not seeing the actual error from the log file. But it seems gcc is missing either a header file or a library file.
answered Nov 13, 2013 at 14:16
damienfrancoisdamienfrancois
49.7k9 gold badges90 silver badges102 bronze badges
5
sudo yum install python36 python36-devel python36-libs python36-tools
if using python36, this is the best path for set up. Corrected this error for me on an aws ec2 instance
answered Jan 21, 2019 at 0:51
answered May 21, 2019 at 9:08
1
How i solved
# yum update
# yum install -y https://centos7.iuscommunity.org/ius-release.rpm
# yum install -y python36u python36u-libs python36u-devel python36u-pip
# pip3.6 install pipenv
I hope it will help Someone to resolve «gcc» issue.
answered Aug 14, 2018 at 8:04
Rahul SainiRahul Saini
812 silver badges10 bronze badges
pip install -U pip
pip install -U cython
answered Dec 4, 2020 at 10:20
yum install gcc-c++
centos GCP , this worked for me |
Installing python3 lib implicit.
answered Oct 1, 2021 at 20:10
2
Comments
douglasnaphas
added a commit
to douglasnaphas/madliberation-scripts
that referenced
this issue
Mar 8, 2019
bsuttor
added a commit
to IMIO/imio.devpi
that referenced
this issue
Dec 10, 2019
DhruvilJoshi
added a commit
to DhruvilJoshi/k_means-mpi
that referenced
this issue
Jan 25, 2023
Project was originally done by[1]. I made my own changes for it to work and perform as required, using dataset[2]. There were some issues getting started with mpi4py and somethings were lost between python2 version so had to install the right dependables [3]. The final result of an output run consists of two text files: 1) output_filename_centroids list for each mean, the number of data points in the cluster and the top 50 most important words of the centroid. 2) output_filename_clusters list the mxm track ids in each cluster. References: [1] https://github.com/masenf/mxm_k_means [2] http://millionsongdataset.com/pages/getting-dataset/ [3] scrapy/scrapy#2115
I’ve tried installing whatever was suggested, libssl-dev being the most common answer, but I still receive the error:
PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int);
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/MySQLdb/_mysql.o -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl -o build/lib.linux-x86_64-2.7/MySQLdb/_mysql.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cujwKQ/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cujwKQ/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-dlLRwV/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
I want to install pycodec2 module on raspberry pi os (bullseye). My aim is to be able to use the Codec2 library from Python. I tried the command (sudo apt install codec2) followed by (pip install pycodec2). I tried to build it from source using (python setup.py install), but in both cases it returned this error.
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pycodec2
Using cached pycodec2-2.1.0.tar.gz (62 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pycodec2
Building wheel for pycodec2 (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pycodec2 (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
building 'pycodec2' extension
creating build
creating build/temp.linux-armv7l-cpython-39
creating build/temp.linux-armv7l-cpython-39/pycodec2
arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_23_API_VERSION -I/tmp/pip-build-env-mwt03on3/overlay/lib/python3.9/site-packages/numpy/core/include -I/usr/include/python3.9 -c pycodec2/pycodec2.c -o build/temp.linux-armv7l-cpython-39/pycodec2/pycodec2.o
pycodec2/pycodec2.c: In function ‘__pyx_pf_8pycodec2_6Codec2_14bytes_per_frame’:
pycodec2/pycodec2.c:3379:36: warning: implicit declaration of function ‘codec2_bytes_per_frame’; did you mean ‘codec2_bits_per_frame’? [-Wimplicit-function-declaration]
3379 | __pyx_t_1 = __Pyx_PyInt_From_int(codec2_bytes_per_frame(__pyx_v_self->_c_codec2_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
| ^~~~~~~~~~~~~~~~~~~~~~
| codec2_bits_per_frame
pycodec2/pycodec2.c: In function ‘__pyx_pf_8pycodec2_6Codec2_20rebuild_spare_bit’:
pycodec2/pycodec2.c:3647:93: warning: passing argument 2 of ‘codec2_rebuild_spare_bit’ from incompatible pointer type [-Wincompatible-pointer-types]
3647 | __pyx_t_1 = __Pyx_PyInt_From_int(codec2_rebuild_spare_bit(__pyx_v_self->_c_codec2_state, ((char *)PyArray_DATA(((PyArrayObject *)__pyx_v_unpacked_bits))))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| char *
In file included from pycodec2/pycodec2.c:776:
/usr/include/codec2/codec2.h:110:64: note: expected ‘int *’ but argument is of type ‘char *’
110 | int codec2_rebuild_spare_bit(struct CODEC2 *codec2_state, int unpacked_bits[]);
| ~~~~^~~~~~~~~~~~~~~
pycodec2/pycodec2.c: In function ‘__pyx_pf_8pycodec2_6Codec2_28open_mlfeat’:
pycodec2/pycodec2.c:3995:3: error: too many arguments to function ‘codec2_open_mlfeat’
3995 | codec2_open_mlfeat(__pyx_v_self->_c_codec2_state, __pyx_t_1, __pyx_t_2);
| ^~~~~~~~~~~~~~~~~~
In file included from pycodec2/pycodec2.c:776:
/usr/include/codec2/codec2.h:116:6: note: declared here
116 | void codec2_open_mlfeat(struct CODEC2 *codec2_state, char *filename);
| ^~~~~~~~~~~~~~~~~~
error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycodec2
Failed to build pycodec2
ERROR: Could not build wheels for pycodec2, which is required to install pyproject.toml-based projects
