pyinstaller编译打包为pyd


pip install Cython

我们在需要打包的.py所在的文件夹新建py文件,在此处命名为build_pyd.py,其内容如下:

from distutils.core import setup
from Cython.Build import cythonize

setup(
    name='any words.....',
    ext_modules=cythonize(["需要引入的外部包.py", ]),
)

执行以下cmd命令

python build_pyd.py build_ext --inplace

等pyd文件即编译好,执行pyinstaller打包py文件

pyinstaller .\****.py

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM