栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何创建一个.pyd文件?

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何创建一个.pyd文件?

您必须

setup.py
在终端中运行文件。这是一个使用的例子
numpy

try:    from setuptools import setup    from setuptools import Extensionexcept importError:    from distutils.core import setup    from distutils.extension import Extensionfrom Cython.Distutils import build_extimport numpy as npext_modules = [Extension("my_pre_cython",["my_pre_cython.pyx"]),    Extension("another_pre_cython",["another_pre_cython.pyx"])]setup(    name= 'Generic model class',    cmdclass = {'build_ext': build_ext},    include_dirs = [np.get_include()],    ext_modules = ext_modules)

在终端(Windows中为cmd)中,您必须执行命令

python setup.py build_ext --inplace

重要的是,我想您已经安装了编译器(例如,适用于Python 2.7的Microsoft Visual C
++编译器软件包)。您可以在https://github.com/cython/cython/wiki/CythonExtensionsOnWindows中找到更多信息



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/648646.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号