[Python] Error installing uwsgi with pip: "Python.h no such file". python-dev and python3-dev...

Discussão em 'Python' iniciado por Stack, Abril 14, 2025.

  1. Stack

    Stack Membro Participativo

    I'm getting the following error when trying to install uwsgi using pip on ubuntu 18.04:

    $ sudo pip3 install uwsgi
    ...
    plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: No such file or directory
    #include <Python.h>
    ^~~~~~~~~~
    compilation terminated.


    I have installed the python-dev and python3-dev packages. Running locate Python.h shows that it is indeed installed:

    /usr/include/python2.7/Python.h
    /usr/include/python3.6m/Python.h


    I've tried installing using both pip and pip3, and I get the same error. Every other answer to this question points to having python-dev or python3-dev or some variant installed, and I've tried all those. Any ideas what else might cause this?

    Continue reading...

Compartilhe esta Página