Python: ImportError

Archived topics about LMDE 1 and LMDE 2
Locked
Edgpaez

Python: ImportError

Post 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 :)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
vincent

Re: Python: ImportError

Post 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.
Edgpaez

Re: Python: ImportError

Post 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 :(
secipolla

Re: Python: ImportError

Post 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).
Edgpaez

Re: Python: ImportError

Post 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 :?
Edgpaez

Re: Python: ImportError

Post by Edgpaez »

Anyone ?
Please this is really annoying...

Thanks and sorry for double posting
Locked

Return to “LMDE Archive”