492

When I try to install odoo-server, I got the following error:

error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Could anyone help me to solve this issue?

Kenly
  • 24,317
  • 7
  • 44
  • 60
Madura Dissanayake
  • 8,309
  • 5
  • 25
  • 34
  • 9
    Sometimes it's the line above this error you should look at. It should tell you what package is missing. – dan-klasson Feb 22 '18 at 17:01
  • The most frustrating thing is that it hides the actual error message. – Velkan Apr 12 '21 at 13:54
  • If you have received this error message while trying to install Odoo, [Kenly's answer](https://stackoverflow.com/a/35164888/5320906) is the most applicable. Otherwise, consider for a Q&A more specific to the package that you are trying to install, and the object that GCC is unable to locate. – snakecharmerb Jan 12 '23 at 12:04

38 Answers38

600

I encountered the same problem in college having installed Linux Mint for the main project of my final year, the third solution below worked for me.

When encountering this error please note before the error it may say you are missing a package or header file — you should find those and install them and verify if it works (e.g. ssl → libssl).

For Python 2.x use:

sudo apt-get install python-dev

For Python 2.7 use:

sudo apt-get install libffi-dev

For Python 3.x use:

sudo apt-get install python3-dev

or for a specific version of Python 3, replace x with the minor version in

sudo apt-get install python3.x-dev
Bhavesh Odedra
  • 10,990
  • 12
  • 33
  • 58
Paulie
  • 6,535
  • 4
  • 20
  • 35
293

Python.h is nothing but a header file. It is used by gcc to build applications. You need to install a package called python-dev. This package includes header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications.

enter:

$ sudo apt-get install python-dev

or

# apt-get install python-dev

see http://www.cyberciti.biz/faq/debian-ubuntu-linux-python-h-file-not-found-error-solution/

Darek Kay
  • 15,827
  • 7
  • 64
  • 61
Fred
  • 2,971
  • 1
  • 10
  • 3
  • 51
    This did not solve the problem for me: `Reading state information... Done python-dev is already the newest version.` – 8bitjunkie Aug 17 '15 at 22:04
  • 87
    @SummerSun If you're using python3, you should use: $sudo apt-get install python3-dev or $ sudo apt-get install python3.4-dev – Antoine Brunel Apr 01 '16 at 14:52
  • @antoinet but i am using python 2.7.4... I have solved this long ago but i don't remember any specific solution – Summer Sun Apr 04 '16 at 06:22
  • Definitely worked for me: Ubuntu 16.04 64-bit; zshell + tmux – Mr_Spock Jul 08 '17 at 23:56
  • The installation of "python-dev" helped me. I'm installing yara through pip install. Thank you! – jefferson.macedo Nov 12 '17 at 21:52
  • 2
    For python3.x use the command $sudo apt-get install python3.x-dev – SolitaryReaper Jan 09 '19 at 05:03
  • 7
    if you are using ubuntu, you also need to install build-essential. check this answer: https://stackoverflow.com/a/54534118/3453776 – nnov Nov 13 '19 at 12:48
  • Mentioning python version is important, in my case this command installed `python-dev` for python 2.7 which didn't work. But when I mentioned the version like: `sudo apt-get install python3.8-dev` this worked (I also had python 3.8 installed in my machine). See @kame's answer. – hafiz031 Jun 12 '21 at 18:23
  • worked for me. I install a specific old Python version (3.7) and needed to install further dependencies – William Oct 08 '21 at 10:19
203

Try installing these packages.

sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-pil python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev libssl-dev

sudo easy_install greenlet

sudo easy_install gevent
piyush singh
  • 395
  • 8
  • 24
Madura Dissanayake
  • 8,309
  • 5
  • 25
  • 34
  • 5
    i didn't found any reasonable answer about why this error happen! why we need to install all these packages...if possible then kindly explain "'x86_64-linux-gnu-gcc' failed" to me – Shashank Feb 09 '15 at 11:59
  • 164
    Yeah, one of these packages might fix it but it would be nice to know which one particularly – Shane Reustle Feb 17 '15 at 14:37
  • 42
    build-essential and python-dev were enough in my case. – Alfabravo Nov 23 '15 at 00:42
  • 88
    Downvoted for not answering the question. Why do I have to install qt4-docs to fix this problem? – reggie Nov 26 '15 at 10:13
  • 14
    build-essential and python-dev is enough for my – vinayrks Feb 20 '16 at 14:02
  • 1
    should i use python3- for all packages if i want to run on python 3.5.1? – ggnoredo Mar 01 '16 at 07:08
  • The only ones that are necessary are actually build-essential and python-dev – XelharK May 31 '16 at 08:06
  • Just installing this packages on ubuntu 14.4 did the trick for me: >sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-pyre Though this installed "python-dev" as dependency as next solution claims though it might be enough just this package – XiR_ Jul 13 '16 at 04:36
  • 1
    `sudo apt-get install python-dev` solves the problem – Cybersupernova Sep 05 '16 at 20:12
  • I had tried with `build-essential` and `python-dev` but it did not work then finally I just copied full line `sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev` And It worked like a charm :D – Laxmikant Nov 07 '16 at 10:19
  • @ShaneReustle The very last one, actually. Hah – Dodgie Dec 15 '16 at 00:41
  • 1
    Answer does not give a definitive answer to the question, just asks the user to install a bunch of packages in 'hopes' that one of them fixes your problem. – Paulie Mar 23 '18 at 13:36
  • in ubuntu you only need build-essential and python-dev, in linux mint only python-dev – nnov Nov 13 '19 at 12:50
  • 1
    libssl-dev did it for me – Artisan Nov 28 '19 at 11:45
  • For ubuntu server 20.04, build-essential and python-dev did the job. – The Dodo Jun 23 '20 at 09:50
  • 1
    You only need `sudo apt-get install build-essential` and `sudo apt-get install python3.*-dev` – Aymen Alsaadi Oct 29 '20 at 15:17
  • build-essential solved the problem for me. – Joseph Zhou Feb 03 '21 at 05:40
  • It might resolve the problem, no doubts about that, but I believe this is certainly not the "minimum" number of packages that achieve the same result. For example, installing `python3-dev` and `gcc` was enough in my case. – Sal Borrelli Jun 16 '21 at 08:44
  • @Shashank same as me i am using ubuntu 20.04 and Pycharm. i dont know why i need to install python3.x-dev to my source where it is already bulitin on pycharm env. – Mark Anthony Libres Jul 31 '21 at 14:32
  • It is a lot of packages, but everyone's needs will be different. This answer is to ensure you have no issues. It's best too install and test each package, one by one, if your are concerned about too many packages – tno2007 Aug 03 '21 at 15:45
  • For me, adding the additional package including the mentioned as worked like a charm. "RUN apt-get update && apt-get install -y python3 python3-pip libffi-dev libssl-dev cargo \ && pip3 install typing_extensions pdfminer.six" We're using Docker for one of our services. – Vikash Choudhary May 15 '22 at 12:14
142

You need to install these packages:

sudo apt-get install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev libjpeg-dev zlib1g-dev
Kenly
  • 24,317
  • 7
  • 44
  • 60
87

For Python 3.5 use:

sudo apt-get install python3.5-dev

For Python 3.6 use:

sudo apt-get install python3.6-dev

For Python 3.7 use:

sudo apt-get install python3.7-dev

For Python 3.8 use:

sudo apt-get install python3.8-dev

... and so on ...

Intrastellar Explorer
  • 3,005
  • 9
  • 52
  • 119
kame
  • 20,848
  • 33
  • 104
  • 159
73
$ sudo apt-get install gcc
$ sudo apt-get install python-dateutil python-docutils python-feedparser python-gdata python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-psycopg2 python-psutil python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi

OR TRY THIS:

$ sudo apt-get install libxml2-dev libxslt1-dev
Wtower
  • 18,848
  • 11
  • 103
  • 80
the-run
  • 977
  • 1
  • 10
  • 21
39

In my case, it was missing package libffi-dev.

What worked:

sudo apt-get install libffi-dev
Kenly
  • 24,317
  • 7
  • 44
  • 60
nikhil komawar
  • 423
  • 4
  • 3
39

For me none of above worked. However, I solved problem with installing libssl-dev.

sudo apt-get install libssl-dev

This might work if you have same error message as in my case:

fatal error: openssl/opensslv.h: No such file or directory ... .... command 'x86_64-linux-gnu-gcc' failed with exit status 1

Ajeet Shah
  • 18,551
  • 8
  • 57
  • 87
linux_fan
  • 407
  • 4
  • 2
  • 2
    Me too. The accepted answer seems a little excessive. – Esteban Sep 30 '16 at 18:14
  • This worked for me as well without having to download a bunch from the accepted answer – DanMossa Nov 29 '16 at 04:37
  • 1
    This is usually this library that is missing when I install cryptography package in python. – Pobe Aug 03 '17 at 14:36
  • This was the issue for me too. I could tell it from the stdout line "src/pycurl.h:164:28: fatal error: openssl/ssl.h: No such file or directory" printed just before the line questioned in this post "error: command 'x86_64-linux-gnu-gcc' failed with exit status 1" – claudod Jul 09 '18 at 15:14
27

In my case following command did the magic

sudo apt-get install gcc python3-dev

if the above command didn't work try following two commands

sudo apt-get install gcc python-dev
  1. this is the case when you want it to install for the python version set as default python in your machine.

Or

sudo apt-get install gcc python3.x-dev
  1. where python3.x represent the version number of python installed on your machine.
officialrahulmandal
  • 2,473
  • 1
  • 23
  • 31
17

on ubuntu 14.04:

sudo apt-file search ffi.h 

returned:

chipmunk-dev: /usr/include/chipmunk/chipmunk_ffi.h
ghc-doc: /usr/share/doc/ghc-doc/html/users_guide/ffi.html
jython-doc: /usr/share/doc/jython-doc/html/javadoc/org/python/modules/jffi/jffi.html
libffi-dev: /usr/include/x86_64-linux-gnu/ffi.h
libffi-dev: /usr/share/doc/libffi6/html/Using-libffi.html
libgirepository1.0-dev: /usr/include/gobject-introspection-1.0/girffi.h
libgirepository1.0-doc: /usr/share/gtk-doc/html/gi/gi-girffi.html
mlton-basis: /usr/lib/mlton/include/basis-ffi.h
pypy-doc: /usr/share/doc/pypy-doc/html/config/objspace.usemodules._ffi.html
pypy-doc: /usr/share/doc/pypy-doc/html/config/objspace.usemodules._rawffi.html
pypy-doc: /usr/share/doc/pypy-doc/html/rffi.html

I chose to install libffi-dev

sudo apt-get install libffi-dev

worked perfectly

Evyatar Sivan
  • 582
  • 6
  • 21
  • 3
    Not only this solution helped me fix my `ffi.h` missing dependency but also helped fixing other missing dependencies. Thanks! – Dário Sep 27 '16 at 10:13
  • This really helped. I was missing file called ```pcrecpp.h```. And the package I had to install was ```libpcre3-dev```. – Jeetendra Pujari Feb 21 '20 at 19:06
17

In my case pip was unable to install libraries, I tried solutions given above, but none worked but the below worked for me:

sudo apt upgrade gcc
yunus
  • 2,445
  • 1
  • 14
  • 12
11

Despite being an old question, I'll add my opinion.

I think the right answer depends on the error message of the gcc compiler, something like "Missing xxxx.h"

This might help in some cases:

sudo apt-get install build-essential python-dev
user2106495
  • 189
  • 1
  • 5
9

This was enough for me:

sudo apt-get install build-essential
Evandro Pomatti
  • 13,341
  • 16
  • 97
  • 165
6

In Linux Mint with python3

$ sudo apt install build-essential python3-dev

should be enough

sergiohzlz
  • 113
  • 2
  • 5
5

below answer worked for me, you can try:

sudo apt-get install python3-lxml
armatita
  • 12,825
  • 8
  • 48
  • 49
user6393832
  • 51
  • 1
  • 1
5

Using Ubuntu 14.04 LTS with a virtualenv running python 3.5, I had to do:

sudo apt-get install python3.5-dev

The other commands:

sudo apt-get install python-dev
sudo apt-get install python3-dev

Did not help. I think this is because the virtualenv needs to rely on the system-wide python-dev package and it must match the virtualenv's python version. However, using the above commands installs python-dev for python 2.x and the python 3.x that comes with Ubuntu 14.04 which is 3.4, not 3.5.

CoderGuy123
  • 6,219
  • 5
  • 59
  • 89
5

Error : error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Executing sudo apt-get install python-dev solved the error.

vielkind
  • 2,840
  • 1
  • 16
  • 16
4

After upgrade my computer with pip today, and check the other answers here, I can tell you that it could be ANYTHING. You should check error by error, looking for what's the specific library that you need. In my case, these were the libraries that I had to install:

$ sudo apt-get install libssl-dev
$ sudo apt-get install libffi-dev
$ sudo apt-get install libjpeg-dev
$ sudo apt-get install libvirt-dev
$ sudo apt-get install libsqlite3-dev
$ sudo apt-get install libcurl4-openssl-dev
$ sudo apt-get install libxml2-dev libxslt1-dev python-dev

HTH

Mario S
  • 1,914
  • 1
  • 19
  • 32
4

This works for me, 12.04, python2.7.6

sudo apt-get install libxml2 libxml2-dev libxslt1-dev
sudo apt-get install lxml
Ahmed Nour Eldeen
  • 351
  • 1
  • 4
  • 13
Jesse Yan
  • 199
  • 1
  • 4
4

first you need to find out what the actual problem was. what you're seeing is that the C compiler failed but you don't yet know why. scroll up to where you get the original error. in my case, trying to install some packages using pip3, I found:

    Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-4u59c_8b/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-itjeh3va-record/install-record.txt --single-version-externally-managed --compile --user:
    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory

 #include <ffi.h>

                 ^

compilation terminated.

so in my case I needed to install libffi-dev.

jcomeau_ictx
  • 37,688
  • 6
  • 92
  • 107
  • 1
    For sure, this compiler error presented on the question, is very relative. My case, for example, was just like yours: I was installing `bcrypt` via `pip3`, and the output was quite huge and observing the first messages from `pip3 install bcrypt`, I realized that `libffi-dev` was the package which was causing all the trouble for the next steps of the installation process. Well observed, friend :). I hope you don't my mind, if I give some cents to your answer, which for me, deserves a better consideration. Regards. – ivanleoncz Mar 12 '18 at 20:33
4

In my case the command sudo apt-get install unixodbc-dev resolved the issue. I was getting an error specific to the sql.h header file.

ColossalBoar
  • 101
  • 1
  • 2
  • 13
3
sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev

sudo easy_install greenlet

sudo easy_install gevent
Yogesh Nikam Patil
  • 1,192
  • 13
  • 18
3

Tip: Please do not consider this as an answer. Just to help someone else too.

I had similar issue while installing psycopg2. I installedbuild-essential, python-dev and also libpq-dev but it thrown same error.

error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

As I was in hurry in deployment so finally just copied full line from @user3440631's answer.

sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev

And It worked like a charm. but could not find which package has resolved my issue. Please update the comment if anyone have idea about psycopg2 dependancy package from above command.

Laxmikant
  • 2,046
  • 3
  • 30
  • 44
3
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Lot of time I got the same error when installing M2Crypto & pygraphviz and installed all the things mention in the approved answer. But this below line solved all my problems with the other packages in approved answer too.

sudo apt-get install libssl-dev swig
sudo apt-get install -y graphviz-dev

This swig package saved my life as the solution for M2Crypto and graphviz-dev for pygraphviz. I hope this will help someone.

Kushan Gunasekera
  • 7,268
  • 6
  • 44
  • 58
2

For me I had to make sure I was using the correct version of cryptography. pip.freeze had and older version and once I used the latest the problem when away.

Morvis13
  • 21
  • 1
2

For Centos 7 Use below command to install Python Development Package

Python 2.7

sudo yum install python-dev

Python 3.4

sudo yum install python34-devel

Still if your problem not solved then try installing below packages -

sudo yum install libffi-devel

sudo yum install openssl-devel

Rahul Satal
  • 2,107
  • 3
  • 32
  • 53
1

None of the above answers worked for me when I had the same issue on my Ubuntu 14.04

However, this solved the error:

sudo apt-get install python-numpy libicu-dev

musicakc
  • 488
  • 1
  • 4
  • 15
1

For me it helped to install libxml2-dev and libxslt1-dev.

sudo apt-get install libxml2-dev
Primoz
  • 1,324
  • 2
  • 16
  • 34
1

My stack was like that:

> >                            ^
> >     In file included from /usr/include/openssl/ssl.h:156:0,
> >                      from OpenSSL/crypto/x509.h:17,
> >                      from OpenSSL/crypto/crypto.h:17,
> >                      from OpenSSL/crypto/crl.c:3:
> >     /usr/include/openssl/x509.h:751:15: note: previous declaration of ‘X509_REVOKED_dup’ was here
> >      X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev);
> >                    ^
> >     error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
> >     
> >     ----------------------------------------   Rolling back uninstall of > pyOpenSSL Command "/home/marta/env/pb/bin/python -u -c
> "import setuptools,
> > tokenize;__file__='/tmp/pip-build-14ekWY/pyOpenSSL/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-2HERvW-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/marta/env/pb/include/site/python2.7/pyOpenSSL" failed with error
> > code 1 in /tmp/pip-build-14ekWY/pyOpenSSL/

in the same case, please consider the typo (bug) in one of the installation files and edit it manually by changing "X509_REVOKED_dup" to "X509_REVOKED_dupe" (no quotes). I have edited the x509.h file:

sed -e's/X509_REVOKED_dup/X509_REVOKED_dupe/g' -i usr/include/openssl/x509.h

and it worked for me, but please consult with the post linked below, as they edited another file:

sed -e's/X509_REVOKED_dup/X509_REVOKED_dupe/g' -i OpenSSL/crypto/crl.c

https://groups.google.com/forum/#!topic/kivy-users/Qt0jNIOACZc

fanny
  • 1,373
  • 12
  • 25
1

Like Robin Winslow says in a comment :

I found my solution over here: stackoverflow.com/a/5178444/613540

In my case, my complete error message was :

/usr/bin/ld: cannot find -lz 
collect2: error: ld returned 1 exit status
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I was trying to install torrench :

sudo python3 setup.py install

With given stackoverflow link, I solve this issue by :

sudo apt install zlib1g-dev

Note that the following packages were already installed :

libxslt1-dev is already the newest version.
python3-dev is already the newest version.
libxml2-dev is already the newest version.

Hope that will help !

Vetea
  • 169
  • 1
  • 3
  • 14
1

In my case, it was oursql that was causing the same(generic) error as below.

In file included from oursqlx/oursql.c:236:0:
  oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for oursql
  Running setup.py clean for oursql

So, I knew that I need to have libmysqlcppconn-dev package.

sudo apt-get install libmysqlcppconn-dev

And all good!

Jay Modi
  • 3,161
  • 4
  • 35
  • 52
  • On the general note, I later checked the setup.py file of oursql package and found out that it uses mysqld and thus I installed `sudo apt-get install libmysqld-dev` and it worked for me. – Jay Modi Aug 21 '18 at 16:54
  • macOS solution for oursql installation problems: https://askubuntu.com/questions/663919/how-do-i-install-oursql-using-pip/1086651#1086651 – Jay Modi Oct 24 '18 at 08:08
1

For python3:

sudo apt-get install python3-dev \
     build-essential libssl-dev libffi-dev \
     libxml2-dev libxslt1-dev zlib1g-dev \
     python3-pip

For Python2:

sudo apt-get install python2-dev  \
     build-essential libssl-dev libffi-dev \
     libxml2-dev libxslt1-dev zlib1g-dev \
     python2-pip
ahmnouira
  • 1,607
  • 13
  • 8
0

This Worked for me:

sudo apt install zlib1g-dev

Rastin
  • 151
  • 1
  • 2
0

In addition to some other helpful answers, if docker-compose brought you here--With your venv set, run:


easy_install docker-compose

Bicameral Mind
  • 799
  • 5
  • 9
0

While installing ssdeep i was getting same error Please check actual error can be something else Like i was also getting same but above this error there was an error fuzzy.h no file or directory and then i tried this apt-get -y install libfuzzy-dev

Work like charm

Akshay Kumar
  • 71
  • 2
  • 2
0

TL;DR: run the below command

sudo apt-get install python2-dev gcc

I had this problem when trying to pip install a module for python2.7.

Lots of answers mention that a fix for this is sudo apt-get install python-dev. However, this did not work for me, as the package was not found. However, the command shown at the top of this comment exists, and I was finally able to pip install the module.

Mr Krisey
  • 109
  • 2
  • 10
0

This problem can originate from one of any missing packages especially in newer builds.

        creating build/temp.linux-x86_64-cpython-39/src
    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 -fPIC -I/home/vipin/.cache/pypoetry/virtualenvs/bbox-drf-QjIedbEI-py3.9/include -I/usr/include/python3.9 -c src/base64.c -o build/temp.linux-x86_64-cpython-39/src/base64.o
    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 -fPIC -I/home/vipin/.cache/pypoetry/virtualenvs/bbox-drf-QjIedbEI-py3.9/include -I/usr/include/python3.9 -c src/kerberos.c -o build/temp.linux-x86_64-cpython-39/src/kerberos.o
    In file included from src/kerberos.c:20:
    src/kerberosbasic.h:17:10: fatal error: gssapi/gssapi.h: No such file or directory
       17 | #include <gssapi/gssapi.h>
          |          ^~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
    [end of output]

most of us search using the second last line.

error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

But if you look closely, a few lines above, you can actually see which package is missing. It clearly states that a directory or file is missing

gssapi/gssapi.h: No such file or directory

searching why this package could be the solution you are looking for.

Vipin Mohan
  • 1,631
  • 1
  • 12
  • 22
-1

After installing a lot of libraries, the one that worked for me! was swig:

sudo apt-get install swig

The error arose when installing python's M2Crypto library.

:)

Julio Cesar
  • 255
  • 5
  • 17