微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Python.h:没有安装 python36-devel 的文件或目录

如何解决Python.h:没有安装 python36-devel 的文件或目录

我为此搜索了线程的色调。
当我安装 python-ldap 时,我得到:

  In file included from Modules/LDAPObject.c:3:0:
  Modules/common.h:9:20: Fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  error: command 'gcc' Failed with exit status 1

我有 Python 3.6 并且我已经安装了 python36-developenldap-devel
据我所知:

[xfft@hostname Scripts]$ pkg-config --cflags python
-I/usr/include/python2.7
[xfft@hostname Scripts]$ pkg-config --libs python
-lpython2.7

/usr/include/ 我有

drwxr-xr-x.  2 root root   4096 Apr 28 14:35 python2.7
drwxr-xr-x.  2 root root   4096 Apr 28 14:51 python3.6m

并且在 python3.6m 中有 Python.h
但是如何将 pkg-config --cflags pythonpkg-config --libs python 指向这个目录?

解决方法

如果有人广告类似的问题,以下是解决问题的方法:
我检查了 /opt/rh/rh-python36/root/usr/lib64/ 并且里面没有 pkgconfig 目录。
我缺少的是rh-python36-python-devel。所以这解决了这个问题:

yum install rh-python36-python-devel

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。