python - 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-devel和openldap-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指向这个目录?
解决方案
如果有人提出类似问题,这里是解决问题的方法:
我检查了/opt/rh/rh-python36/root/usr/lib64/并且里面没有pkgconfig目录。
我缺少的是rh-python36-python-devel。所以这解决了这个问题:
yum install rh-python36-python-devel
推荐阅读
- javascript - Javascript html 选择选项
- node.js - Docker 没有正确执行 RUN 命令,也没有读取 dockerignore 文件
- javascript - Material Design 图标按钮无法正常工作
- c# - 为什么 DependencyProperties 需要外观属性/getter/setter
- netsuite - 如何将自定义可编辑字段添加到 Netsuite 中的与会者条目
- c# - 从 C# 程序在 CMD.EXE 中运行多个命令?
- typescript - 为什么要在打字稿中的联合类型文字中添加前面的竖线 (|)?
- reactjs - React Reducer 有一些不好的语法错误
- c# - 关于 DataGridView CellValidation 的困惑
- ios - 如何在我的主 Xcode 项目中运行另一个项目?