LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-15-2017, 09:29 PM   #1
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,834

Rep: Reputation: 108Reputation: 108
modifying a python2 program installed by deb package. -- How to get *.pyc files?


Hya,

System Debian (amd64) buster. Both python2 and python3 are installed.

Situation I'd like to modify 'bibus' program, which is installed by debian package. This is a program written in python2. I found several lines to modify in *.py files. These files were edited by root privilege. I want to compile these modules. Running the program with user privilege did not take care of this issue.

It looks like that *pyc modules are compiled after installation by postinst script.
Code:
...
# Automatically added by dh_python2:
if which pycompile >/dev/null 2>&1; then
        pycompile -p bibus /usr/share/bibus -V 2.5-
fi

# End automatically added section
Question Is it safe to "pycompile" as the script above, when python3 is also installed?

Closing remark I will appreciate any information. Have a happy penguin!
 
Old 08-16-2017, 12:51 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
pyc files are usually generated by the python executable itself, you do not need to take care about that.
In your case the pyc files cannot be saved, so python will always recompile py files and will not use pyc files.
 
Old 03-02-2019, 07:39 PM   #3
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,834

Original Poster
Rep: Reputation: 108Reputation: 108
It looks like (so far no trouble), pycompile works.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] get installed rpm or deb package file Harshit_24 Linux - Newbie 19 01-10-2017 12:15 AM
Is there a way to see when a package (.deb) was installed? ravedog Linux - Newbie 6 06-10-2010 03:50 PM
Python2.5-devel is unable to find installed Python2.5 Setya SUSE / openSUSE 1 06-08-2007 01:35 AM
the last installed deb package, how ? ag2uki Debian 7 08-15-2005 07:44 AM
how can I create a .deb from an installed package? monkeyman2000 Debian 5 06-16-2005 07:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 06:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration