简体   繁体   中英

How to make a .deb file from Python

I want to make .deb package from my Python file and including image files. My program is a simple chat client made using wxPython .

How do I make an easy-to-make .deb package?

My version is Ubuntu 12.04 (Precise Pangolin), Python is version 2.7.3, and wxPython is version 2.8.

My files are wxchat.py and three image (JPEG) files files for the chat client.

If you're making a .deb file for internal use only (ie not submitting it to the Debian community, etc.) there is a tool called stdeb: https://github.com/astraw/stdeb . You can install it using apt-get : sudo apt-get install python-stdeb .

If you have setup.py , you can create a .deb file by these commands:

python setup.py --command-packages=stdeb.command sdist_dsc
cd deb_dist/packagename-versionname/
debuild -uc -us
cd -

You can specify dependencies in stdeb.cfg :

[DEFAULT]
Depends:
    python-wxgtk2.8
# You can restrict versions of the packages
    python-wxtools (>= 2.8)
# Note that comments should start from the first character of the line

There are a lot of resources on the Internet that describe how to do this:

You will have to make sure you've included the dependencies that you need to run your package. In your case it would be wxPython and any other packages that you need present that aren't part of the Python standard library.

If you just want to package your software for distribution you might want to consider creating a Python package and putting it on http://pypi.python.org . You can learn how to do that in the CheeseShopTutorial . It tends to be a simpler process, and it means that you can distribute beyond Debian systems to rpm based Linux installs and Mac, Windows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM