You are not logged in.

#1 2012-09-20 21:41:35

using_GNU
Member
Registered: 2012-07-30
Posts: 32

[solved]A litttle problem with python pygtk and pyqt.

Greetings gentlemen.

when i try to launch screenlets, this happens:

[dragora@irya ~]$ screenlets
cat: /etc/screenlets/prefix: No existe el fichero o el directorio
Traceback (most recent call last):
  File "/usr/share/screenlets-manager/screenlets-manager.py", line 31, in <module>
    import pygtk
ImportError: No module named pygtk

when i try to launch wicd, this happens

dragora@irya ~]$ wicd-client 
Traceback (most recent call last):
  File "/usr/share/wicd/gtk/wicd-client.py", line 40, in <module>
    import gtk

and when i try to launch freecad, it works well, but a strange message prints in the terminal:


No module named PyQt4


I have pyqt and pygtk installed

[dragora@irya ~]$ pacman -Ss pyqt 
extra/eric 5.2.5-1
    A full-featured Python 3.x and Ruby IDE in PyQt4
extra/eric4 4.5.6-1
    A full-featured Python 2.x and Ruby IDE in PyQt4
extra/pyqt 4.9.4-2 [instalado]
    A set of Python 3.x bindings for the Qt toolkit
extra/pyqt-common 4.9.4-2 [instalado]
    Common PyQt files shared between pyqt and python2-pyqt
extra/python2-pyqt 4.9.4-2 [instalado]
    A set of Python 2.x bindings for the Qt toolkit
community/pyqt3 3.18.1-10
    A set of Python bindings for the Qt3 toolkit
[dragora@irya ~]$ pacman -Ss pygtk
extra/pygtk 2.24.0-3 [instalado]
    Python bindings for the GTK widget set
extra/pygtksourceview2 2.10.1-4
    Python bindings for gtksourceview2
extra/quodlibet 2.4.1-1
    An audio player written in pygtk
extra/system-config-printer-common 1.3.10-1
    Pygtk CUPS Configuration
community/emesene 2.12.5-1
    A pygtk MSN Messenger client
community/gtk-recordmydesktop 0.3.8-6
    A pygtk frontend for recordmydesktop
community/kiwi 1.9.29-2
    A set of classes and wrappers for PyGTK
community/pympd 0.08.1-3
    A Rhythmbox-like PyGTK+ client for Music Player Daemon
community/wifi-radar 2.0.s08-4
    A PyGTK2 utility for managing WiFi profiles


Is very strange for me, and is not and urgent problem, but i would like to know what is happening in the system.


Thank you

Last edited by using_GNU (2012-09-21 10:52:37)

Offline

#2 2012-09-20 21:44:45

mrlithid
Member
Registered: 2012-01-07
Posts: 12

Re: [solved]A litttle problem with python pygtk and pyqt.

Which python version are you currently using? 2 or 3?

Offline

#3 2012-09-20 22:11:15

using_GNU
Member
Registered: 2012-07-30
Posts: 32

Re: [solved]A litttle problem with python pygtk and pyqt.

Both are installed on my system

Last edited by using_GNU (2012-09-20 22:11:46)

Offline

#4 2012-09-20 23:57:35

mrlithid
Member
Registered: 2012-01-07
Posts: 12

Re: [solved]A litttle problem with python pygtk and pyqt.

Right. By default arch uses python3. A lot of applications are still using Python2. Try symlinking python to python2 instead of 3. That may be your issue.

Offline

#5 2012-09-21 07:43:19

using_GNU
Member
Registered: 2012-07-30
Posts: 32

Re: [solved]A litttle problem with python pygtk and pyqt.

Sorry, but how I do that?, What symbolic links i must create?, And where i place them?

Last edited by using_GNU (2012-09-21 07:43:46)

Offline

#6 2012-09-21 08:59:20

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [solved]A litttle problem with python pygtk and pyqt.

Really, that should be a bug in the package then. Package managers need to make sure that all scripts in the package call the correct Python binary.

using_GNU: I wouldn't recommend symlinking python to python2 because that will break other Arch packages which all expect python to be a link to python3.

As a quick stopgap, if you set the environment variable PYTHON to /usr/bin/python2, assuming the screenlets script behaves, it should use python2 instead. Otherwise, find the screenlets script (presumably /usr/bin/screenlets; I don't have it installed) and change the first line from #!/usr/bin/python (or maybe #!env python) to #!/usr/bin/python2.


Edit: actually, the screenlets install script properly does the conversion: https://projects.archlinux.org/svntogit … k/PKGBUILD

Last edited by jakobcreutzfeldt (2012-09-21 09:01:37)

Offline

#7 2012-09-21 09:02:31

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [solved]A litttle problem with python pygtk and pyqt.

using_GNU: can you post the output of

$ ls -l /usr/bin/python*

Offline

#8 2012-09-21 09:16:16

using_GNU
Member
Registered: 2012-07-30
Posts: 32

Re: [solved]A litttle problem with python pygtk and pyqt.

[dragora@irya ~]$ ls -l /usr/bin/python*
lrwxrwxrwx 1 root root    9 abr 24 02:02 /usr/bin/python2 -> python2.7
lrwxrwxrwx 1 root root   16 abr 24 02:02 /usr/bin/python2-config -> python2.7-config
-rwxr-xr-x 1 root root   94 jul 17 19:55 /usr/bin/python2-pyuic4
-rwxr-xr-x 1 root root 6248 abr 24 02:02 /usr/bin/python2.7
-rwxr-xr-x 1 root root 1618 abr 24 02:02 /usr/bin/python2.7-config

Offline

#9 2012-09-21 09:37:36

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [solved]A litttle problem with python pygtk and pyqt.

Ok...first of all, not related, but you only have Python 2 installed, not Python 3 wink

Anyway, it's strange since pygtk is only available for Python 2 so it should work. I'm wondering if something got screwed up with your PYTHONPATH. Try running the Python 2 interpreter and importing pygtk:

$ python2
>>> import pygtk

Are any exceptions thrown?

Offline

#10 2012-09-21 09:47:26

using_GNU
Member
Registered: 2012-07-30
Posts: 32

Re: [solved]A litttle problem with python pygtk and pyqt.

ups...

this is the output

[dragora@irya ~]$ python2
Python 2.7.3 (default, Apr 24 2012, 00:00:54) 
[GCC 4.7.0 20120414 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygtk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pygtk

and


[dragora@irya ~]$ pacman -Ss pygtk
extra/pygtk 2.24.0-3 [instalado]
    Python bindings for the GTK widget set

This is strange...

what do you think?

Offline

#11 2012-09-21 09:52:02

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [solved]A litttle problem with python pygtk and pyqt.

What is the output of these commands in Python?

>>> import sys
>>> sys.path

Offline

#12 2012-09-21 09:54:39

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [solved]A litttle problem with python pygtk and pyqt.

Also:

$ ls -l /usr/lib/python2.7/site-packages/pygtk*
$ cat /usr/lib/python2.7/site-packages/pygtk.pth

Offline

#13 2012-09-21 09:55:46

using_GNU
Member
Registered: 2012-07-30
Posts: 32

Re: [solved]A litttle problem with python pygtk and pyqt.

>>> import sys
>>> sys.path
['', '/usr/lib/python27.zip', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/lib/python2.7/site-packages']

Offline

#14 2012-09-21 09:59:41

using_GNU
Member
Registered: 2012-07-30
Posts: 32

Re: [solved]A litttle problem with python pygtk and pyqt.

[dragora@irya ~]$ ls -l /usr/lib/python2.7/site-packages/pygtk*
ls: no se puede acceder a /usr/lib/python2.7/site-packages/pygtk*: No existe el fichero o el directorio
/* it can't access because it doesn't exist???? */

:-(

[dragora@irya ~]$ cat /usr/lib/python2.7/site-packages/pygtk.pth
cat: /usr/lib/python2.7/site-packages/pygtk.pth: No existe el fichero o el directorio

:-( but i have pygtk installed

Offline

#15 2012-09-21 10:00:21

using_GNU
Member
Registered: 2012-07-30
Posts: 32

Re: [solved]A litttle problem with python pygtk and pyqt.

and i also have reinstalled all of these packages.

Offline

#16 2012-09-21 10:00:23

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [solved]A litttle problem with python pygtk and pyqt.

using_GNU wrote:
>>> import sys
>>> sys.path
['', '/usr/lib/python27.zip', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/lib/python2.7/site-packages']

Strange, mine includes '/usr/lib/python2.7/site-packages/gtk-2.0'.

This isn't a permanent fix, but try this:

>>> import sys
>>> sys.path.append('/usr/lib/python2.7/site-packages/gtk-2.0')
>>> import gtk

Offline

#17 2012-09-21 10:02:36

using_GNU
Member
Registered: 2012-07-30
Posts: 32

Re: [solved]A litttle problem with python pygtk and pyqt.

>>> import sys
>>> sys.path.append('/usr/lib/python2.7/site-packages/gtk-2.0')
>>> import gtk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 30, in <module>
    import gobject as _gobject
ImportError: No module named gobject

Offline

#18 2012-09-21 10:06:15

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,778
Website

Re: [solved]A litttle problem with python pygtk and pyqt.

Try re/installing python2-gobject2.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#19 2012-09-21 10:12:47

using_GNU
Member
Registered: 2012-07-30
Posts: 32

Re: [solved]A litttle problem with python pygtk and pyqt.

>>> import sys

>>> sys.path.append('/usr/lib/python2.7/site-packages/gtk-2.0')
>>> import gtk

** (process:4673): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'

** (process:4673): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'

** (process:4673): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
>>> 

ok, but this is the result

Offline

#20 2012-09-21 10:17:04

using_GNU
Member
Registered: 2012-07-30
Posts: 32

Re: [solved]A litttle problem with python pygtk and pyqt.

Hey, the reinstalation of python2-gobject2 and python2-cairo, are making progress, now, the output is another:


[dragora@irya ~]$ screenlets
cat: /etc/screenlets/prefix: No existe el fichero o el directorio

** (process:4686): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'

** (process:4686): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'

** (process:4686): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
Traceback (most recent call last):
  File "/usr/share/screenlets-manager/screenlets-manager.py", line 34, in <module>
    import screenlets
  File "/usr/lib/python2.7/site-packages/screenlets/__init__.py", line 52, in <module>
    from xdg.BaseDirectory import *
ImportError: No module named xdg.BaseDirectory

Offline

#21 2012-09-21 10:31:55

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [solved]A litttle problem with python pygtk and pyqt.

Try installing python2-xdg


This is all weird. I'm tempted to tell you to just reinstall everything python-related.

Offline

#22 2012-09-21 10:36:32

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [solved]A litttle problem with python pygtk and pyqt.

Wait, screenlets depends on pyxdg. pyxdg doesn't exist, but instead it should be python2-xdg. So that required package wasn't installed when it should have been. This should be reported as a bug.

Last edited by jakobcreutzfeldt (2012-09-21 10:37:35)

Offline

#23 2012-09-21 10:38:39

using_GNU
Member
Registered: 2012-07-30
Posts: 32

Re: [solved]A litttle problem with python pygtk and pyqt.

now it works, but i want to ask, if there is a comand in pacman that let me to reinstall every python2 related (packages that depends on python2).

once i've learned the comand, if exist, i will clasify this post as solved.

Thank you a lot for the unbeliavable help. You are awesome.

Offline

#24 2012-09-21 10:45:01

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [solved]A litttle problem with python pygtk and pyqt.

In principle, you can do this:

# pacman -S `pacman -Qqs python2`

However, if you have installed any Python2 packages from the AUR, it will fail. You can identify these packages in advance with

$ pacman -Qm

.

Offline

#25 2012-09-21 10:51:47

using_GNU
Member
Registered: 2012-07-30
Posts: 32

Re: [solved]A litttle problem with python pygtk and pyqt.

All in order now, let's see if this post help another people as well.

Thank you, until next time.

I hope I would help other people in the same way you helped me. wink

Offline

Board footer

Powered by FluxBB