Ich versuche, uswgi in einer virutalen Umgebung auf Linux Ubuntu, Python 3.5.2 .__ zu installieren
pip install uwsgi
Ich habe diesen Fehler bekommen
Failed building wheel for uwsgi
und am Ende der Installationsprotokolle
*** uWSGI compiling embedded plugins ***
[thread 0][x86_64-linux-gnu-gcc -pthread] plugins/python/python_plugin.o
[thread 1][x86_64-linux-gnu-gcc -pthread] plugins/python/pyutils.o
In file included from plugins/python/python_plugin.c:1:0:
plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory
compilation terminated.
In file included from plugins/python/pyutils.c:1:0:
plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory
compilation terminated.
----------------------------------------
Command "/home/ubuntu/envflask/env/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wthov1ur/uwsgi/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-quiupta5-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/envflask/env/include/site/python3.5/uwsgi" failed with error code 1 in /tmp/pip-build-wthov1ur/uwsgi/
Gibt es eine Lösung dafür? Vielen Dank
Sie müssen Python3.5-Entwicklungsdateien installieren. Führen Sie daher den folgenden Befehl aus:
apt-get install python3.5-dev
Mit dem obigen Befehl werden Python 3-Header installiert, um uWSGI aus der Quelle zu erstellen.
apt-get install build-essential python3-dev
Aus der uWSGI Dokumentation :
uWSGI ist eine (große) C-Anwendung, daher benötigen Sie einen C-Compiler (wie gcc oder clang) und die Python-Entwicklungsheader . Auf einer Debian-basierten Distribution eine
apt-get install build-essential python-dev
wird ausreichen.
Ändern Sie für Python3 einfach python3-dev
.
$ python3 --version
Python 3.5.2
$ pip3 freeze
uWSGI==2.0.15
Debian hat ein Paket, das von allen unterstützten Python 3-Entwicklungspaketen abhängt:
apt-get install python3-all-dev
wenn Sie bei der Installation von uwsgi unter python3.6 .__
apt-get install python3.6-dev
In meinem Fall wurde uwsgi via buildout installiert
HINWEIS: Möglicherweise sollten Sie gültige PPA hinzufügen
Für openSUSE (Tumbleweed)
pip install uwsgi
wenn Sie den Befehl uwsgi installieren möchten, klicken Sie auf
curl http://uwsgi.it/install | bash -s default /tmp/uwsgi
mv/tmp/uwsgi nach/usr/local was auch immer
Für alle, die mit Python 3.6 das gleiche Problem haben, ist hier der Schritt zur Lösung dieses Problems:
Holen Sie sich Python 3.6-Entwicklerwerkzeuge von diesem PPA:
Sudo add-apt-repository ppa:deadsnakes/ppa
Aktualisieren Sie dann Ihre Paketliste mit:
Sudo apt-get update
und installieren Sie dann Ihre Dev Tools mit der Version 3.6
apt-get install build-essential python3.6-dev
Aktivieren Sie Ihre virtuelle Umgebung mit und installieren Sie dann uwsgi:
pip install uwsgi