作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
哪些配置标志/make 标志对此负责?
如果我不启用此功能,我就没有缓冲区 API。更不用说将其设置为默认值并不是一个好主意...并且该文档没有提及使用某些 Python 的 API 是基于此编译时设置...
实际上,它也不是使用 Python 3.5 构建的。我误读了诊断消息。
最佳答案
以下 setup.py
示例将编译 foo.cpp
以将 py_limited_api
设置为 False
:
from setuptools import setup, Extension
setup(
name='foo',
ext_modules=[Extension('foo', ['foo.cpp'], py_limited_api=False)],
)
确保在包含 Python.h
之前没有 #define Py_LIMITED_API ...
您可以使用以下语句测试 Py_LIMITED_API
是否存在:
#ifdef Py_LIMITED_API
#error Py_LIMITED_API is set
#endif
#include <Python.h>
...
编辑:
您可以通过运行来编译模块:
python setup.py build_ext --inplace
或者通过创建一个轮子:
python setup.py bdist_wheel
关于python - 构建Python : how to disable Py_LIMITED_API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50504270/
哪些配置标志/make 标志对此负责? 如果我不启用此功能,我就没有缓冲区 API。更不用说将其设置为默认值并不是一个好主意...并且该文档没有提及使用某些 Python 的 API 是基于此编译时设
我是一名优秀的程序员,十分优秀!