您的位置:首页 > 编程语言 > Python开发

ubuntu17 python3.6 出错 找不到 Python.h 安装uwsgi

2017-06-09 10:46 567 查看
在virtualenv中使用python3.6安装uwsgi时,老是提示找不到 Python.h

plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: 没有那个文件或目录

     #include <Python.h>

              ^~~~~~~~~~

安装完python-dev,python3-dev还是不行,而且python3.5可以正常安装uwsgi,

`locate Python.h`可以发现python2.7和python3.5都有这个文件,都在/usr/include下面。

直接用`cp -r /usr/include/python3.5m /usr/include/python3.6m`再install uwsgi则是报“/usr/bin/ld: 找不到 -lpython3.6m”的错误。

本来已经打算下载uwsgi的源码包下来本地安装了,幸好看了这篇博客:http://eminzhang.blog.51cto.com/5292425/1285705/

然后一个命令就搞定了:

sudo apt-get install libpython3.6-dev


再重新

pip install uwsgi


发现装上了。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息