Package configuration errors when using python3 (Easy fix)

Post your bugs here.
MatthewLM
Posts: 42
Joined: 19 Apr 2014 12:05

Package configuration errors when using python3 (Easy fix)

Postby MatthewLM » 17 Dec 2014 15:31

When using python3 as the debian alternative for the python command, many configurations fail because they try to run python 2 code using python3. The solution is for the installer scripts to explicitly specify python2, which I suspect to be a simple fix. Here is an example of an error:

Code: Select all

Setting up python-keybinder (0.3.0-3) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-keybinder (--configure):
 subprocess installed post-installation script returned error exit status 1
There may be many packages with this problem but I got problems for the following packages which were resolved once I switched to python2:

Code: Select all

Errors were encountered while processing:
 python-keybinder
 ddm
 solydxk-sws
 terminator
 solydxk-system
Also terminator does not specify python2 in its starting script:

Code: Select all

  File "/usr/bin/terminator", line 103
    except (KeyError,ValueError), ex:
                                ^
SyntaxError: invalid syntax
Solution: Change line 1 of /usr/bin/terminator to:

Code: Select all

#! /usr/bin/python2
In fact it's best to find all packages using "#! /usr/bin/python" and add a 2 on the end.

User avatar
fleabus
Posts: 1227
Joined: 16 Sep 2013 04:24
Location: Winchester, VA USA

Re: Package configuration errors when using python3 (Easy fi

Postby fleabus » 17 Dec 2014 15:54

I've also seen this when updating.

I assume that package updates might possibly revert these changes? Please correct me if I'm wrong, not trying to be snarky, I really don't know... ? :)

MatthewLM
Posts: 42
Joined: 19 Apr 2014 12:05

Re: Package configuration errors when using python3 (Easy fi

Postby MatthewLM » 17 Dec 2014 16:02

I'm saying that the packages should not be like this. From what I could briefly find out it seems at least some of these packages are fixed upstream, but if not they should be fixed by the SolydXK maintainers and the package maintainers upstream should be notified also.

For users the solution would be to change to python2 before running updates and possibly use python2 as the default python and remember to use the python3 command if python3 is desired.

User avatar
fleabus
Posts: 1227
Joined: 16 Sep 2013 04:24
Location: Winchester, VA USA

Re: Package configuration errors when using python3 (Easy fi

Postby fleabus » 17 Dec 2014 16:03

Thanks. Figured that was a mostly-distro-level fix.

I get to ask one dumb question per day. :lol:

User avatar
Arjen Balfoort
Site Admin
Posts: 9429
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Package configuration errors when using python3 (Easy fi

Postby Arjen Balfoort » 17 Dec 2014 17:14

Thanks for reporting this.

I'm working on a new DDM and I plan to convert all python2 applications I maintain to python3.
solydxk-system has a few very old (from the Mint era) that I just converted and testing right now.

If anyone reading this would like to help out, I've posted here for help on DDM: http://forums.solydxk.nl/viewtopic.php? ... 204#p49204


SolydXK needs you!
Development | Testing | Translations

User avatar
Snap
Posts: 1244
Joined: 25 Aug 2013 20:01
Location: Spain

Re: Package configuration errors when using python3 (Easy fi

Postby Snap » 18 Dec 2014 08:40

Wish I could. Definitely I need to learn bash and python scripting... :roll:
This likely means that your installation is broken. -Mr Pixbuf.

Image


Return to “Bug Control”

Who is online

Users browsing this forum: No registered users and 9 guests