Python: ImportError

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

Python: ImportError

Postby Edgpaez on 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 :)
Edgpaez
Level 1
Level 1
 
Posts: 17
Joined: Tue Dec 07, 2010 11:36 am

Linux Mint is funded by ads and donations.
 

Re: Python: ImportError

Postby vincent on 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
vincent
Level 8
Level 8
 
Posts: 2220
Joined: Tue Feb 09, 2010 4:10 am

Re: Python: ImportError

Postby Edgpaez on 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 :(
Edgpaez
Level 1
Level 1
 
Posts: 17
Joined: Tue Dec 07, 2010 11:36 am

Re: Python: ImportError

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

Re: Python: ImportError

Postby Edgpaez on 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: 17
Joined: Tue Dec 07, 2010 11:36 am

Re: Python: ImportError

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

Anyone ?
Please this is really annoying...

Thanks and sorry for double posting
Edgpaez
Level 1
Level 1
 
Posts: 17
Joined: Tue Dec 07, 2010 11:36 am


Return to Newbie Questions

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests