The python-pmw package is a toolkit for building compound Tkinter widgetsâ. For the following demo, you need to have the following installed: python-pmw tkinter tkinter3 In Python2, the Tkinter package is imported as 'Tkinter' whereas in Python3 it is imported as 'tkinter': $ /usr/bin/python2.7 Python 2.7.6 (default, Mar 18 2014, 22:18:46) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Tkinter >>> import tkinter Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named tkinter >>> $ /usr/bin/python3.3 Python 3.3.2 (default, Mar 21 2014, 23:44:23) [GCC 4.8.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import Tkinter Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named 'Tkinter' >>> import tkinter >>> Therefore to use python-pmw with Python2, it needs to import Tkinter (or at least have portability code to map 'Tkinter' to 'tkinter'), but if you run the commands $ grep -r "import Tkinter" /usr/lib/python2.7/site-packages/Pmw/ $ grep -r "import tkinter" /usr/lib/python2.7/site-packages/Pmw/ it will be clear that python-pmw is set up for Python3 and will not run on Python2. This causes the external program PyMOL to fail (http://sourceforge.net/projects/pymol/). It will probably cause many other Python programs using tk to also fail.
According to the Pmw sourceforge website http://sourceforge.net/projects/pmw/: "Python megawidgets is Python 3 compatible through the Pmw 2 download. Pmw 1 is destined for Python 2. Both are now accessible through the new pypi compatible package (credits for which go to Andy Robinson and the team at ReportLab)." And according to https://pypi.python.org/pypi/Pmw/2.0.0: "The package contains both Pmw 2.0.0 - the Python 3 version - and Pmw 1.3.3 - the Python 2 version - and installs the correct version automatically." Therefore it looks like two python-pmw packages need to be distributed in Mageia. The current package python-pmw-2.0.0-0.3.mga4.noarch is for Python3 (but is installed into the Python2.7 directories), and the Pmw 1.3.3 version needs to be packaged for Python2. This is probably why python-pmw is broken in Mageia 4.
As a workaround, if it hasn't already been fixed in Mageia, run the following as root: # urpme python-pmw # Uninstall the broken python-pmw package. # urpmi python-pip # Install PIP for Python2. # urpmi python3-pip # Install PIP for Python3. # pip install pmw # Install the PyPI Pmw package for Python2. # python3-pip install pmw # Install the PyPI Pmw package for Python3. Everything should now be functional. Pwm-1.3.3 is installed in /usr/lib/python2.7/site-packages/Pmw/Pmw_1_3_3, and Pwm-2.0.0 in /usr/lib/python3.3/site-packages/Pmw/Pmw_2_0_0.
Assignee: bugsquad => makowski.mageia
Suggested advisory: ======================== Updated python-pmw packages fix mga#13143 Python2 and Python3 versions are correctly handled. Updated packages in core/updates_testing: ======================== python-pmw-2.0.0-0.3.1.mga4.noarch python3-pmw-2.0.0-0.3.1.mga4.noarch From : python-pmw-2.0.0-0.3.1.mga4.src
Assignee: makowski.mageia => qa-bugs
for information, here a link for tests : http://pmw.sourceforge.net/doc/howtouse.html
CC: (none) => makowski.mageia
Source RPM: (none) => python-pmwWhiteboard: (none) => has_procedure
Under Mageia4 x86_64 : Before update : $ LC_ALL="C" sudo urpmi python-pmw To satisfy dependencies, the following packages are going to be installed: Package Version Release Arch (medium "Core Release (local1)") blt 2.5 4.mga4 x86_64 python-pmw 2.0.0 0.3.mga4 noarch 7.2MB of additional disk space will be used. 1.9MB of packages will be retrieved. Proceed with the installation of the 2 packages? (Y/n) Y http://192.168.0.2/mageia/4/x86_64/media/core/release/blt-2.5-4.mga4.x86_64.rpm http://192.168.0.2/mageia/4/x86_64/media/core/release/python-pmw-2.0.0-0.3.mga4.noarch.rpm installing python-pmw-2.0.0-0.3.mga4.noarch.rpm blt-2.5-4.mga4.x86_64.rpm from /var/cache/urpmi/rpms Preparing... ###################################################################################### 1/2: blt ###################################################################################### 2/2: python-pmw ###################################################################################### $ LC_ALL="C" python Python 2.7.6 (default, Mar 18 2014, 22:18:46) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Pmw >>> root = Pmw.initialise() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/site-packages/Pmw/Pmw_2_0_0/lib/PmwLoader.py", line 131, in __getattr__ self._initialise() File "/usr/lib/python2.7/site-packages/Pmw/Pmw_2_0_0/lib/PmwLoader.py", line 89, in _initialise raise ImportError(msg) ImportError: No module named tkinter >>> exit() After update : $ LC_ALL="C" sudo urpmi python-pmw python3-pmw To satisfy dependencies, the following packages are going to be installed: Package Version Release Arch (medium "Core Updates (local3)") tkinter3 3.3.2 13.2.mga4 x86_64 (medium "Core Updates Testing (local5)") python-pmw 2.0.0 0.3.1.mga4 noarch python3-pmw 2.0.0 0.3.1.mga4 noarch 5.1MB of additional disk space will be used. 1.5MB of packages will be retrieved. Proceed with the installation of the 3 packages? (Y/n) http://192.168.0.2/mageia/4/x86_64/media/core/updates/tkinter3-3.3.2-13.2.mga4.x86_64.rpm http://192.168.0.2/mageia/4/x86_64/media/core/updates_testing/python-pmw-2.0.0-0.3.1.mga4.noarch.rpm http://192.168.0.2/mageia/4/x86_64/media/core/updates_testing/python3-pmw-2.0.0-0.3.1.mga4.noarch.rpm installing python3-pmw-2.0.0-0.3.1.mga4.noarch.rpm tkinter3-3.3.2-13.2.mga4.x86_64.rpm python-pmw-2.0.0-0.3.1.mga4.noarch.rpm from /var/cache/urpmi/rpms Preparing... ###################################################################################### 1/3: tkinter3 ###################################################################################### 2/3: python3-pmw ###################################################################################### 3/3: python-pmw ###################################################################################### 1/1: removing python-pmw-2.0.0-0.3.mga4.noarch ###################################################################################### $ LC_ALL="C" python Python 2.7.6 (default, Mar 18 2014, 22:18:46) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Pmw >>> root = Pmw.initialise() >>> counter1 = Pmw.Counter() >>> counter1.pack(padx = 10, pady = 10) >>> exit() $ LC_ALL="C" python3 Python 3.3.2 (default, Mar 21 2014, 23:44:23) [GCC 4.8.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import Pmw >>> root = Pmw.initialise() >>> counter1 = Pmw.Counter() >>> counter1.pack(padx = 10, pady = 10) >>> exit() $
Whiteboard: has_procedure => has_procedure mga4-64-ok
Hi, Under Mageia4 i586 after update testing, i do as Philippe in comment 5 The packages in udpate testing fix the bug. (both fo python / python 3)
CC: (none) => inster.css
Whiteboard: has_procedure mga4-64-ok => has_procedure mga4-64-ok mga4-32-ok
Advisory uploaded. Before validating Philippe, is there a reason for the strange release numbering of this one? python-pmw-2.0.0-0.3.1.mga4 I notice it's mkrel 0.3 and subrel 1. Is this expected/correct? Thanks
Whiteboard: has_procedure mga4-64-ok mga4-32-ok => has_procedure advisory mga4-64-ok mga4-32-ok
yes, it was because it was released in mageia4 with an upstream rc release I guess.
OK thanks. Validating. Could sysadmin please push to 4 updates Thanks
Keywords: (none) => validated_updateCC: (none) => sysadmin-bugs
http://advisories.mageia.org/MGAA-2014-0102.html
Status: NEW => RESOLVEDCC: (none) => mageiaResolution: (none) => FIXED