1. 程式人生 > >pip install uwsgi安裝uwsgi出錯

pip install uwsgi安裝uwsgi出錯

使用python3.6安裝uwsgi 老出錯找不到 Python.h

plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory  compilation terminated.


網上搜了很多方法都沒解決。仔細研究一番之後發現Python版本造成的,

首先找到pip安裝目錄,

$ pip install pip
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Requirement already satisfied: pip in /usr/local/lib/python3.6/dist-packages (10.0.1)

發現是Python3.6

那麼安裝3.6的python-dev,大概幾分鐘

$ sudo apt-get install libpython3.6-dev 

再次執行

$ pip install uwsgi

測試uwsgi是否安裝成功完成

$ uwsgi --version
2.0.17
完成