【问题标题】:How to add a Python file to the installed targets with Cython and distutils?如何使用 Cython 和 distutils 将 Python 文件添加到已安装的目标?
【发布时间】:2013-11-27 10:05:12
【问题描述】:

我正在使用 Cython 构建一个名为“_mymodule”的扩展。我需要将此扩展的导入包装在“mymodule.py”中,以添加一些我更喜欢在纯 Python 中提供的功能。

我按照 Cython 文档 (http://docs.cython.org/src/userguide/source_files_and_compilation.html) 创建了一个 setup.py 文件来编译和安装扩展程序 ("_mymodule.so") 但是我如何告诉这个安装脚本也包括 "mymodule.py" ?

【问题讨论】:

    标签: python cython distutils


    【解决方案1】:

    我添加了选项:

    packages = ['.']
    

    到 setup() 函数以包含 .py 文件。

    【讨论】:

      猜你喜欢
      • 2021-07-18
      • 2010-09-19
      • 2011-04-18
      • 1970-01-01
      • 1970-01-01
      • 2010-09-23
      • 1970-01-01
      • 2010-11-28
      • 2023-03-04
      相关资源
      最近更新 更多