analitics

Pages

Showing posts with label pygobject. Show all posts
Showing posts with label pygobject. Show all posts

Saturday, September 2, 2023

Python 3.11.4 : Issues in Fedora with PyGobject and sway-tests

Today I wanted to test this repo named sway-tests.
I followed the steps there and received an error from gi.repository.
This error is related to another issue related to PyGobject.
In Fedora Linux distro, installing PyGobject is done with pip like this:
$ pip install PyGobject
In order to have no errors, the dnf or dnf5 tool should be used like this ...
I tested the functionality of this installation with a simple example:
import gi

gi.require_version("Gtk", "3.0")
from gi.repository import Gtk

win = Gtk.Window()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()
It worked very well.
After solving this issue, I returned to the initial one and tested the sway-tests.
$ whereis sway
$ env/bin/pytest --sway=/usr/bin/sway
$ sudo env/bin/pytest --sway=/usr/bin/sway
I used the command both with and without sudo.
Both generated the same errors.
For the following command I had to install ... xorg-x11-server-Xephyr:
Xephyr is an X server which has been implemented as an ordinary X application. It runs in a window just like other X applications, but it is an X server ...
... the fixed centered black window specific to the xorg runtime appeared and somewhere on the side the terminal showed me a bunch of errors.
... obviously, I don't know how well sway-tests is implemented, now it's an archived repo, but I solved the use of PyGobject in python on the Fedora linux distribution.

Saturday, December 10, 2016

The python modules pygobject, pycairo and pygtk under Windows OS.

I used the python version 2.7 32 bits under .
C:\Python27>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (
Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

The issue is to instal PyGTK python module but you can see I got errors.
C:\>cd Python27

C:\Python27>cd script
The system cannot find the path specified.

C:\Python27>cd Scripts

C:\Python27\Scripts>pip install PyGTK
Collecting PyGTK
Downloading pygtk-2.24.0.tar.bz2 (2.4MB)
100% |################################| 2.4MB 224kB/s
Complete output from command python setup.py egg_info:
ERROR: Could not import dsextras module: Make sure you have installed pygobj
ect.

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\my_account
\appdata\local\temp\pip-build-os60hf\PyGTK\

C:\Python27\Scripts>pip install pygobject
Collecting pygobject
Downloading pygobject-2.28.3.tar.bz2 (889kB)
100% |################################| 890kB 550kB/s
Complete output from command python setup.py egg_info:
ERROR: Could not find pkg-config: Please check your PATH environment variabl
e.

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\my_account
\appdata\local\temp\pip-build-lt0gbh\pygobject\

I got the pygobject-2.28.3.win32-py2.7.msi, pycairo-1.8.10.win32-py2.7.msi and pygtk-2.24.0.win32-py2.7.msi from gnome website.
I install this python modules using registry and this option: Python from another location and I set my python path: C:\Python27\
>>> import gobject
>>> dir(gobject)
['GBoxed', 'GEnum', 'GError', 'GFlags', 'GInterface', 'GObject', 'GObjectMeta',
...
>>> import cairo
>>> dir(cairo)
['ANTIALIAS_DEFAULT', 'ANTIALIAS_GRAY', 'ANTIALIAS_NONE', 'ANTIALIAS_SUBPIXEL',
>>> import pygtk
>>> dir(pygtk)
['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_
get_available_versions', '_our_dir', '_pygtk_2_0_dir', '_pygtk_dir_pat', '_pygtk
_required_version', 'fnmatch', 'glob', 'os', 'require', 'require20', 'sys']


As you can see this python modules works well.