日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

uwsgi 安装报错 plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory

發(fā)布時間:2023/11/27 生活经验 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 uwsgi 安装报错 plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1. Python3 安裝 uwsgi 報錯

直接使用命令 sudo pip3 install uwsgi 安裝如下錯誤:

ubuntu@ubuntu:~/Downloads$ sudo pip3 install uwsgi
Collecting uwsgiDownloading uwsgi-2.0.18.tar.gz (801 kB)|████████████████████████████████| 801 kB 28 kB/s 
Building wheels for collected packages: uwsgiBuilding wheel for uwsgi (setup.py) ... errorERROR: Command errored out with exit status 1:command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xe2_vojh/uwsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xe2_vojh/uwsgi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d In file included from plugins/python/pyloader.c:1:0:plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directorycompilation terminated.

2. 解決方法

2.1 安裝 aptitude

sudo apt-get install aptitude

2.2 使用 aptitude 安裝依賴 python3-dev

sudo aptitude install python3-dev

注意:依次輸入 n、y、y,詳細內(nèi)容見下:

ubuntu@ubuntu:~/Downloads$ sudo aptitude install python3-dev
The following NEW packages will be installed:libpython3-dev{a} libpython3.5-dev{ab} python3-dev python3.5-dev{ab} 
0 packages upgraded, 4 newly installed, 0 to remove and 38 not upgraded.
Need to get 37.7 MB of archives. After unpacking 53.9 MB will be used.
The following packages have unmet dependencies:python3.5-dev : Depends: python3.5 (= 3.5.1-10) but 3.5.2-2ubuntu0~16.04.5 is installed.Depends: libpython3.5 (= 3.5.1-10) but 3.5.2-2ubuntu0~16.04.5 is installed.libpython3.5-dev : Depends: libpython3.5-stdlib (= 3.5.1-10) but 3.5.2-2ubuntu0~16.04.5 is installed.Depends: libpython3.5 (= 3.5.1-10) but 3.5.2-2ubuntu0~16.04.5 is installed.
The following actions will resolve these dependencies:Keep the following packages at their current version:
1)     libpython3-dev [Not Installed]                     
2)     libpython3.5-dev [Not Installed]                   
3)     python3-dev [Not Installed]                        
4)     python3.5-dev [Not Installed]                      Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:Downgrade the following packages:                                         
1)     libpython3.5 [3.5.2-2ubuntu0~16.04.5 (now) -> 3.5.1-10 (xenial)]        
2)     libpython3.5-minimal [3.5.2-2ubuntu0~16.04.5 (now) -> 3.5.1-10 (xenial)]
3)     libpython3.5-stdlib [3.5.2-2ubuntu0~16.04.5 (now) -> 3.5.1-10 (xenial)] 
4)     python3.5 [3.5.2-2ubuntu0~16.04.5 (now) -> 3.5.1-10 (xenial)]           
5)     python3.5-minimal [3.5.2-2ubuntu0~16.04.5 (now) -> 3.5.1-10 (xenial)]   Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:libpython3.5 libpython3.5-minimal libpython3.5-stdlib python3.5 python3.5-minimal 
The following NEW packages will be installed:libpython3-dev{a} libpython3.5-dev{a} python3-dev python3.5-dev{a} 
0 packages upgraded, 4 newly installed, 5 downgraded, 0 to remove and 38 not upgraded.
Need to get 43.4 MB of archives. After unpacking 53.7 MB will be used.
Do you want to continue? [Y/n/?] y
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:47ubuntu@ubuntu:~/Downloads$ 

2.3 再執(zhí)行 sudo pip3 install uwsgi

sudo pip3 install uwsgi

驗證是否安裝成功

ubuntu@ubuntu:~/Downloads$ uwsgi --version
2.0.18
ubuntu@ubuntu:~/Downloads$ 

總結(jié)

以上是生活随笔為你收集整理的uwsgi 安装报错 plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。