Python: ImportError

Archived topics about LMDE 1
Forum rules
Edgpaez
Level 1
Level 1
Posts: 16
Joined: Tue Dec 07, 2010 11:36 am

Python: ImportError

Postby Edgpaez » Sat Dec 25, 2010 10:18 pm

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 :)

vincent
Level 8
Level 8
Posts: 2218
Joined: Tue Feb 09, 2010 4:10 am

Re: Python: ImportError

Postby vincent » Sun Dec 26, 2010 4:10 am

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.
Debian Testing x64/LM9 Main x64/Windows 7 x64 - LG R580 laptop w/ Intel Core 2 Duo T6500 2.1 GHz, 4 GB DDR2 RAM, Nvidia Geforce G 105M, Ralink rt2860 802.11n, 300 GB WD HD 5400 rpm

Edgpaez
Level 1
Level 1
Posts: 16
Joined: Tue Dec 07, 2010 11:36 am

Re: Python: ImportError

Postby Edgpaez » Mon Dec 27, 2010 3:57 pm

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
Level 4
Level 4
Posts: 356
Joined: Sun Sep 05, 2010 5:19 pm

Re: Python: ImportError

Postby secipolla » Mon Dec 27, 2010 4:58 pm

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
Level 1
Level 1
Posts: 16
Joined: Tue Dec 07, 2010 11:36 am

Re: Python: ImportError

Postby Edgpaez » Mon Dec 27, 2010 5:33 pm

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
Level 1
Level 1
Posts: 16
Joined: Tue Dec 07, 2010 11:36 am

Re: Python: ImportError

Postby Edgpaez » Tue Dec 28, 2010 11:44 pm

Anyone ?
Please this is really annoying...

Thanks and sorry for double posting


Return to “Archive”

Who is online

Users browsing this forum: No registered users and 1 guest