RPM package contains Python script, need to ignore PYc, PYO bytecode file

Source: Internet
Author: User
Tags python script

When making RPM packages, there are sometimes python programs that typically have the default behavior: When packaged, the Python script is compiled into a pyc,pyo bytecode file and placed in the RPM package, which can lead to errors in referencing missing files when packaging.


If you do not need these bytecode files, you can modify

/usr/lib/rpm/brp-python-bytecompile

Find the two commands that compile the pyc,pyo, annotate them, or exit with exit 0 directly at the beginning of the script.


Note, however, that if you have already hit the package and failed on the missing steps of the Pyc,pyo file, you may have left the files in the packaged temp directory, and you need to delete the temporary directory (usually under/var/tmp/) and then re-perform the packaging operation.



RPM package contains Python script, need to ignore PYc, PYO bytecode file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.