Page 1 of 1

Python: ImportError

Posted: Sat Dec 25, 2010 10:18 pm
by Edgpaez
Hello...

I'm getting a rare problem and I'm out of ideas... My LMDE was working perfectly until yesterday after I installed Glade:

Code: Select all

sudo apt-get -t experimental install glade
it said it had a lot of files to remove (I didn't found anything I could need so I said Y), then after a reboot everything is gone to hell....

Now AWN modules, alacarte, mint-anything, guake, etc,etc don't work. In terminal they ALL give

Code: Select all

/usr/lib/pymodules/python2.6/gtk-2.0/gtk/__init__.py:40: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
  from gtk import _gtk
ImportError: could not import gio
ImportError: could not import gio
cannot import name xxx from gtk
amog other things, of course, I've tried:

Code: Select all

sudo apt-get update
sudo apt-get purge glade
sudo apt-get install --reinstall python
sudo apt-get install --reinstall python3
and nothing works... funny thing is that running "python" and "python3" brings me a fully functional interpreter without problems...
But when I type "import gtk" I get:

Code: Select all

import gtk
/usr/lib/pymodules/python2.6/gtk-2.0/gtk/__init__.py:40: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
  from gtk import _gtk
ImportError: could not import gio
ImportError: could not import gio
So now, what should I do ?

Thanks in advace :)

Re: Python: ImportError

Posted: Sun Dec 26, 2010 4:10 am
by vincent
I assume you didn't keep a list of what was uninstalled when you installed Glade? Well...

Code: Select all

cat /var/log/dpkg.log
Start looking in there and piece together the info you need to put your system back in shape.

Re: Python: ImportError

Posted: Mon Dec 27, 2010 3:57 pm
by Edgpaez
Thanks vincent, I'm reading the file right now and I've found some libs that were removed but can't now be installed, I found that python-dev was uninstalled, so I tried to install it, but I get:

Code: Select all

sudo apt-get install python-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-dev : Depends: python (= 2.6.6-3+squeeze4) but 2.6.6-9 is to be installed
              Depends: python2.6-dev (>= 2.6.6-1~) but it is not going to be installed
E: Broken packages
I tried with python3-dev with the same result, and python3.1-dev gives me:

Code: Select all

sudo apt-get install python3.1-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3.1-dev : Depends: libssl-dev but it is not going to be installed
E: Broken packages
Now I'm starting to believe something is reaaaaally wrong...

Also, I noticed that "echo $PYTHONPATH" prints nothing, could it be a problem ?

Thanks again :(

Re: Python: ImportError

Posted: Mon Dec 27, 2010 4:58 pm
by secipolla
You may have to downgrade anything that was pulled from the experimental repo. For that you need to force the installtion of the version from testing of those packages with aptitude (apt-get doesn't do that).

Re: Python: ImportError

Posted: Mon Dec 27, 2010 5:33 pm
by Edgpaez
The only thing I installed from experimental repos was banshee 1.9.0, so I'm pretty sure that can't be the problem.
Plus, Glade is already installed from the stable repos.

Thanks for helping :?

Re: Python: ImportError

Posted: Tue Dec 28, 2010 11:44 pm
by Edgpaez
Anyone ?
Please this is really annoying...

Thanks and sorry for double posting