簡體   English   中英

Python Windows Installer具有所有依賴項?

[英]Python Windows Installer with all dependencies?

我在PyPI存儲庫中有一個包。 我通過運行以下命令來包含Windows安裝程序以上載新版本,特別是'bdist_wininst':

python3 setup.py register sdist bdist_wininst upload

但是,當用戶運行關聯的.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'
    ],
)

您應該定義一下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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM