【发布时间】:2015-11-08 13:33:53
【问题描述】:
我有下一个案例:
- 使用 Python + PySide 的桌面应用程序
- 想在我的应用程序中使用 PYD 文件 (mycore.pyd)
- mycore.pyx 文件中有一个对 Padding 模块的依赖项
- 此 Padding 模块已安装到系统中
- 我构建了 Setup.py 并将 PYX 文件转换为 PYD 文件,以便在应用程序中使用
我得到了什么:
- 一旦我在 PyCharm 下运行我的应用程序 => 一切正常
- 当我使用 PyInstaller 方法构建应用程序并从 cmd => 运行应用程序时,我发现一个错误“没有命名模块填充(请求等)”
setup.py 文件示例:
from distutils.core import setup
from Cython.Build import cythonize
extensions = ["mycore.pyx"]
setup(
name='mycore',
version='1.0',
ext_modules=cythonize(extensions),
#packages=['Padding'], - once tried => "error: package directory 'Padding' does not exist"
)
任何想法或建议都会很棒!
更新
还尝试了setup_tools的变体,也没有成功:
from Cython.Build import cythonize
from setuptools import setup, find_packages, Extension, Command
setup(name='mycore',
packages = find_packages(),
version=1.0,
include_package_data=True,
platforms=['all'],
ext_modules=[Extension("mycore", ['mycore.c'])],
#extra_require = {"Padding"} - also nothing
)
【问题讨论】:
-
你试过使用'setuptools.find_packages()'pythonhosted.org/setuptools/setuptools.html#using-find-packages
-
我尝试使用
setup_tools,但仍然遇到同样的问题
标签: python pyqt setuptools pyinstaller cpython