Comment 12 for bug 680627

Revision history for this message
Patrick Spinler (spinler-patrick) wrote : Re: Error starting Virtual Machine Manager: No module named version

Ah ha! I think I have nailed the issue, at least for me: it's a combination of a python module import path error, and left over debris of an earlier virtinst: take a look:

First, notice that my python doesn't even have a module path that includes /usr/share/pyshared:

pjs11@patslinux01 ~ $ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/Numeric', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.6/gtk-2.0', '/usr/local/lib/python2.6/dist-packages']
>>>

Next, notice that I have multiple instances of the python virtinst package, and one is considerably older:

pjs11@patslinux01 ~ $ ls -idl /usr/share/pyshared/virtinst* /usr/lib/python2.6/dist-packages/virtinst*
438053 drwxr-xr-x 2 root root 4096 2011-02-18 11:45 /usr/lib/python2.6/dist-packages/virtinst
438054 lrwxrwxrwx 1 root root 45 2010-04-08 16:38 /usr/lib/python2.6/dist-packages/virtinst-0.300.2.egg-info -> /usr/share/pyshared/virtinst-0.300.2.egg-info
398964 drwxr-xr-x 2 root root 4096 2011-02-18 11:51 /usr/share/pyshared/virtinst
621357 -rw-r--r-- 1 root root 275 2010-10-12 15:32 /usr/share/pyshared/virtinst-0.500.1-py2.6.egg-info

And notice that the older one is not owned by any package:

pjs11@patslinux01 ~ $ dpkg-query --search /usr/lib/python2.6/dist-packages/virtinst*
dpkg: /usr/lib/python2.6/dist-packages/virtinst not found.
dpkg: /usr/lib/python2.6/dist-packages/virtinst-0.300.2.egg-info not found.

Finally, notice that if I make use of the current directory import path in my sys.path (the null string ""), by cd'ing to /usr/share/pyshared, then "import virtinst" works:

pjs11@patslinux01 ~ $ cd /usr/share/pyshared
pjs11@patslinux01 pyshared $ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import virtinst
>>>

So, my fix is to first, delete the old, leftover and unowned package, and second fix my import path (and btw -- why does the sys import path even contain the current directory -- isn't that kinda a bad security policy?)

I know how to do the first, I just delete the unowned files, but where do I adjust the second, the import path?

Thanks,
-- Pat