Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to build a .deb package (python) as part of a larger project. I'm able to successfully run 'make' and 'make install' on it, but when the package(s) are built (using dpkg-buildpackage -rfakeroot), none of the .pyc files are included in the .deb. This, in fact, is the case for all the python packages inside this project.

Here is my .install file:


What would cause the *.pyc files to not be included in the .deb? I see all the files in debian/tmp/usr/lib/python2.7/dist-packages/..., debian/update/usr/lib/python2.7/dist-packages/..., but there are no .pyc files in debian/update/DEBIAN/usr/lib/python2.7/dist-packages/...

share|improve this question
up vote 1 down vote accepted

It depends which packaging tool you use. The recommended one is dh_python2. If you use that one, *.pyc and *.pyo are automatically excluded. But a postinst-script is created which will compile your scripts on install time. See also the man page of dh_python2.

share|improve this answer
I tried to verify that dh_python2 was being used and saw that dh_pysupport was used instead. I've moved dh_pysupport out of the way and now am seeing .pyc's inside the .deb. Thank you for your help. – Piotrek Mar 19 '13 at 18:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.