Ziyuan Ma
Ziyuan Ma

Reputation: 113

How to install pyatspi?

I'm using ldtp and while I import it ,my idle jump out with a error:

from ldtp import *
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/ldtpd/__init__.py", line 38, in <module>
from xmlrpc_daemon import XMLRPCLdtpd
File "/usr/local/lib/python2.7/site-packages/ldtpd/xmlrpc_daemon.py",line 25, in <module>
import core
File "/usr/local/lib/python2.7/site-packages/ldtpd/core.py", line 24, in <module>
from pyatspi import findDescendant, Registry
ImportError: No module named pyatspi

And then I yum install pyatspi but found

No package pyatspi available.

Then I download pyatspi-2.20.0.tar.xz

During ./configure ,an error occurs as

configure: error: Package requirements (pygobject-3.0 >= 2.90.1) were not met:
No package 'pygobject-3.0' found

So I go back and try to install pygobject and found:

configure: error: Package requirements (glib-2.0 >= 2.24.0
gobject-introspection-1.0 >= 1.29.0
) were not met:
No package 'gobject-introspection-1.0' found

Excuse me ???

Is that the same thing we all have to suffer during install pyatspi???

What should I do to jump out from this nightmare?

Thanks for any help !

Upvotes: 5

Views: 5273

Answers (1)

Dima Chubarov
Dima Chubarov

Reputation: 17179

pyatspi is a part of GNOME. What you got involved into by building pyatspi from source was leading you into building a significant part of GNOME from source. No easy task at all.

Your best bet is to find AT SPI package for your distribution. You did not specify what linux distribution do you have. But for most common distributions such packages exist.

First make sure you have got python-gobject installed

For rpm-based distributions

 rpm -q python-gobject

For dpkg-based:

 dpkg -s python-gobject

Install it if necessary.

Next install a package containing pyatspi for your distribution. For instance for OpenSUSE you need to install python-atspi

zypper in python-atspi

For Ubuntu and derivatives it is python-pyatspi:

apt-get install python-pyatspi

For RedHat, Fedora and derivatives it is at-spi-python

yum install at-spi-python

Having got that you should be able to type

python -c "import gi,pyatspi"

Upvotes: 4

Related Questions