Pymol Doesn't Initialize after Upgrading to Python 2.6

Bug #340085 reported by Timothy Palpant
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
pymol (Ubuntu)
Fix Released
High
Morten Kjeldgaard

Bug Description

While the last rebuild updated Pymol's python dependency to include 2.6, it crashes with the following error:

Error: unable to initalize the pymol.cmd module
Traceback (most recent call last):
  File "/var/lib/python-support/python2.6/pymol/cmd.py", line 265, in <module>
    from api import *
  File "/var/lib/python-support/python2.6/pymol/api.py", line 381
     as = show_as
      ^
 SyntaxError: invalid syntax

It looks like this problem is already known; by examining the source of api.py I found this:

# dang! Python 2.6 will break PyMOL's "as" method.
# Proposal:
# 1. stick with Python <=2.5 for as long as possible
# 2. convert API method to cmd.show_as() and leave "as" in the scripting langauge
# 3. allow "show_as" in the scripting language
as = show_as

While I'm not sure exactly what's going on (never touched Python), commenting out the final line seems to correct the problem--or at least allow Pymol to start.

Related branches

description: updated
Revision history for this message
Morten Kjeldgaard (mok0) wrote :

I'd like an FFe for this upload.

I get the following error message when attempting to install the current jaunty pymol_1.1-1ubuntu1:

Processing triggers for python-support ...
Compiling /var/lib/python-support/python2.6/chempy/fast/__init__.py ...
SyntaxError: ('invalid syntax', ('/var/lib/python-support/python2.6/chempy/fast/__init__.py', 67, 23, ' ll = as[attrib]\n'))

Compiling /var/lib/python-support/python2.6/pymol/api.py ...
SyntaxError: ('invalid syntax', ('/var/lib/python-support/python2.6/pymol/api.py', 381, 2, 'as = show_as\n'))

Attached patch contains a fix.

Changed in pymol (Ubuntu):
assignee: nobody → Morten Kjeldgaard (mok0)
importance: Undecided → High
Revision history for this message
Martin Pitt (pitti) wrote :

I unsubscribed ubuntu-release, there's no FF to approve here (it's just a bug fix). I subscribed ubuntu-universe-sponsors for getting it uploaded.

Revision history for this message
Scott Kitterman (kitterman) wrote :

ack from motu-release.

Morten Kjeldgaard (mok0)
Changed in pymol (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pymol - 1.1-1ubuntu2

---------------
pymol (1.1-1ubuntu2) jaunty; urgency=low

  * Fix complaints when installing, "as" can no longer be used
    as a variable name (LP: #340085). The consequence is that
    the "as" keyword has become "show_as" (changed as proposed
    by upstream).

 -- Morten Kjeldgaard <email address hidden> Wed, 15 Apr 2009 14:24:39 +0200

Changed in pymol (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Gergely Katona (gkatona) wrote :

I am still having problem with python2.6 in jaunty after the fix. The toolbar does not show up with the following error message.

 OpenGL graphics engine:
  GL_VENDOR: NVIDIA Corporation
  GL_RENDERER: Quadro FX 3450/4000 SDI/PCI/SSE2
  GL_VERSION: 2.1.2 NVIDIA 180.44
Traceback (most recent call last):
  File "/var/lib/python-support/python2.6/pymol/__init__.py", line 400, in launch_gui
    __import__(self.invocation.options.gui)
  File "/var/lib/python-support/python2.6/pmg_tk/__init__.py", line 22, in <module>
    from PMGApp import *
  File "/var/lib/python-support/python2.6/pmg_tk/PMGApp.py", line 31, in <module>
    import Pmw
ImportError: No module named Pmw
 Adapting to Quadro hardware.Setting-Error: type read mismatch (float) -1

 Detected 2 CPU cores. Enabled multithreaded rendering.

 Changing to python2.5 in the pymol wrapper script partly solves the problem, the toolbar is back however a new error " Setting-Error: type read mismatch (float) -1 " shows up repeatedly. On the other hand pymol can load and display molecules, but there might be other adverse effects upon switching back to python2.5.

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 340085] Re: Pymol Doesn't Initialize after Upgrading to Python 2.6

please file a new bug for this. We'll need to figure it out in a
post-release update.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.