Python Windows Installer具有所有依赖项?

Dav*_*son 14 python windows installer pypi python-3.x

我在PyPI存储库中有一个包.我通过运行以下命令来包含Windows安装程序以上载新版本,特别是'bdist_wininst':

python3 setup.py register sdist bdist_wininst upload
Run Code Online (Sandbox Code Playgroud)

但是,当用户运行关联的.exe文件时,它不会安装Python 3本身.此外,即使安装了Python 3,它也不会安装任何相关的依赖项.

如果没有安装Python 3,以及我的软件包及其依赖项,那么创建安装Python 3的Windows安装程序的最佳方法是什么?

如果那是不可能的,假设安装了Python 3,创建安装我的软件包及其依赖项的Windows安装程序的最佳方法是什么?

我在Ubuntu 12.04上.如果有任何帮助,这是我的setup.py:

from distutils.core import setup

import codecs 
try: 
    codecs.lookup('mbcs') 
except LookupError: 
    ascii = codecs.lookup('ascii') 
    func = lambda name, enc=ascii: {True: enc}.get(name=='mbcs') 
    codecs.register(func) 

setup(
    name='SIGACTor',
    version='0.1.14dev',
    description=open('README.txt').read(),
    url='http://bitbucket.org/davidystephenson/sigactor',
    author='David Y. Stephenson',
    author_email='david@davidystephenson.com',
    packages=['sigactor'],
    license='Proprietary',
    long_description=open('README.txt').read(),
    install_requires=[
        'beautifulsoup4',
        'feedparser',
        'python-dateutil',
        'pyyaml'
    ],
)
Run Code Online (Sandbox Code Playgroud)

den*_*ufa 5

您应该明确尝试pynsist,它可以将Python与您的软件包捆绑在一起,并且基于完善的NSIS开源安装程序:

https://pypi.python.org/pypi/pynsist

Anaconda团队再次提供了基于conda和NSIS的Constructor:

https://github.com/conda/constructor

最后,这种方法使用WinPython和最稳定的安装程序InnoSetup:

http://cyrille.rossant.net/create-a-standalone-windows-installer-for-your-python-application/

但是,如果您的软件包不是库而是应用程序,则可以将其与Python和所有依赖项捆绑(冻结),甚至可以使用pyinstaller对其进行压缩:

http://www.pyinstaller.org

这就是我所有应用程序都使用的内容,即使存在疯狂的互操作性依赖!

奖励-pyinstaller的自动更新工具:

https://github.com/JMSwag/PyUpdater