h:没有安装python36devel的文件或目录

2024-10-03 15:33:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经为这个搜索了线的音调。
当我安装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

我有Python3.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-python和pkg-config--libs-python指向这个目录呢


Tags: modulesconfigincludeusrscriptspkgdevelerror
1条回答
网友
1楼 · 发布于 2024-10-03 15:33:06

如果有人提出类似问题,以下是解决问题的方法:
我已经检查了/opt/rh/rh-python36/root/usr/lib64/,里面没有pkgconfig目录。
我缺少的是rh-python36-python-devel。因此,这解决了问题:

yum install rh-python36-python-devel

相关问题 更多 >