Python with Gtk3 not setting unicode properly

I have some simple code that isn't working as expected. First, the docs say that Gtk.Clipboard.get(Gdk.SELECTION_PRIMARY).set_text() should be able to accept only one argument with the length...

How to remove the default sort function from a TreeSortable?

The official Gtk3 C documentation for the GtkTreeSortable set_default_func states that setting the sort function to a Null value would remove the default sort function and thus a treeview once the...

Gnome-terminal not starting due to error in python script related to GI

When I run gnome-terminal, I get the following error: Traceback (most recent call last): File "/usr/bin/gnome-terminal", line 9, in <module> from gi.repository import GLib, Gio File...

How to show a video in a Gtk dialog?

I want to show a video in a dialog. Therefore I create a Gst.DrawingArea and a Gst.Pipeline with a Gst.Element "playbin" in it. I created a little example, it opens a window with a button. If the...

ModuleNotFoundError: No module named 'gi'

I am trying to run the following program: import gi gi.require_version('Gst', '1.0') from gi.repository import GObject, Gst Bu I am getting: Traceback (most recent call last): File...

pip3 install not working - No module named 'pip._vendor.pkg_resources'

When trying to install a package for Python 3 (in Ubuntu), using pip3 install packageName (or sudo pip3 install packageName), I get the following error message: Traceback (most recent call last): ...

Python playsound works in IDLE but gives "no module called gi" error in Thonny; mixed result in Ubuntu terminal

I was trying to use the playsound function from the playsound module in Python 3. I obtained an mp3 file of a fire alarm sound from http://soundbible.com/1656-House-Fire-Alarm.html to test and...

Multiprocessing.Queue with hugh data causes _wait_for_tstate_lock

An Exception is raised in threading._wait_for_tstate_lock when I transfere hugh data between a Process and a Thread via multiprocessing.Queue. My minimal working example looks a bit complex first...

Problem playing audio with playsound on python3

Testing on RaspberryPi3 B+ model and have just 2 lines of py code. Python version 3.5.3 from playsound import playsound playsound("alarm.wav") I get error below, even after installing packages...

Android + Kivy: fails to run Camera demo, possibly library or permission problem?

I'm looking for help getting the Kivy Camera demo to work on Android. I believe there is some kind of library or permissions problem. It builds and starts, but immediately after the Kivy loading...

Cannot import name '_gi'

I'm trying to add a repository to ppa with the add-apt-repository commands but the _gi module from Python is not found. I did this command : sudo add-apt-repository ppa:s-mankowski/ppa-kf5 Here is...

ImportError: cannot import name '_gi' from partially initialized module 'gi' (most likely due to a circular import)

Looks like I have broken my python installation when I wanted to switch to python 3.8. Using Ubuntu 18.04. Trying to use the gi, gives the following error: $ python Python 3.8.1 (default, Dec 31...

How to assign “hidden data” to Gtk.TreeView row in order to catch them with Gtk.TreeView.connect("row-activated")?

In Python, I have a class person witch contain firstName and lastName and also country attributes (actually their is much more other data, but I simplify it for the example). So, I generate a...

certbort commands return ModuleNotFoundError: No module named '_cffi_backend'

I followed a guide to get my python flask app running and I am at the last step where I change http into https with certbot. But when I run my certbot command sudo certbot --nginx -d domainname -d...

RuntimeError: Gtk couldn't be initialized. Use Gtk.init_check() if you want to handle this case

I have the following sample script coded in python 3.8.2: import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk class GridWindow(Gtk.Window): def __init__(self): ...

Docker Installation: ImportError: cannot import name '_gi' from 'gi' (/usr/lib/python3/dist-packages/gi/__init__.py)

I am getting following error while Adding the Docker repository to APT sources for installing docker in ubuntu 18.04 using this tutorial install docker ubuntu 18.04: $ sudo add-apt-repository "deb...

No module 'gi' and ImportError: The GTK3 backends require PyGObject error

I am trying to run some code on an AWS ec2 (ubuntu). When I comment out the portion that displays graphs from matplotlib, it runs fine. However, I want to view graphs. When running the code, I get...

Python3: Namespace AppIndicator3 not available

OS: Kubuntu 18.04 I have a Python program (program.py) that has this at the beginning: import shlex import sys import notify2 import os import gi gi.require_version("Gtk", "3.0") from...

Installing kivy in venv on Ubuntu

I'm trying to install kivy. According to this guide I used the commands: $ python3 -m venv my_kivy_project $ cd my_kivy_project $ source bin/activate $ python -m pip install kivy This...

"Namespace Gst not available" error when using playsound module in Raspbian os

I recently came across the playsound module and I tried my Python IDE in my Raspbian os it's giving me some error: from playsound import playsound playsound('/home/pi/mu_code/music.mp3') This...

fatal error: cuda_runtime_api.h: No such file or directory when trying to use cuda in docker

I am trying to build a docker image for a python script that I would like to deploy. This is the first time I am using docker so I'm probably doing something wrong but I have no clue what. My...

RuntimeError: cuda runtime error (48) : no kernel image is available for execution on the device at mmdet/ops/roi_a lign/src/roi_align_kernel.cu:139

I'm having a little trouble using my code on a google compute engine VM. I am trying to run a small flask API that detects tables in images. Initializing the detector model works, but when i try...

Is there a guide for converting a gstreamer pipeline to python code?

I am trying to implement a simple gstreamer pipeline that works okay through terminal command (gst-launch-1.0 filesrc location=sample.264 ! h264parse ! decodebin ! videoconvert ! autovideosink)...

E: Unable to locate package python-pygraphviz E: Package 'ipython' has no installation candidate

I wanted to use ns3 for which some prerequisites have to be met in Ubuntu. (https://www.nsnam.org/wiki/Installation) First of all I cannot use apt-get install python-pygraphviz python-kiwi...

Segmentation fault (core dumped) on training the deep neural network /torch/cuda/__init__.py", line 172 in _lazy_init

python3 -q -X faulthandler test.py --model.backbone=resnet18 2021-02-07 20:14:21.198583: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library...

Problem importing Cairo after installation in Google-Colaboratory

I successfully installed Cairo on Colab, but I receive the following error when trying to import it. !apt-get install python3-Cairo ModuleNotFoundError: No module named 'cairo._cairo' I also tried...

Difficulty getting google-coral example-object-detection to work properly

Noob here, trying to run google-coral example-object-detection on a new google mini dev board. I have followed all of the instructions for set up of the device and loading the example, models,...

Getting segmentation fault in import gi.repository in Python PyGobject?

I have installed gstreamer from source using cerbero with the help of this link...

NVIDIA cuda enabled docker container issue - UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount()

I am trying to use the base images provided by NVIDIA that let us use their GPUs via Docker containers. Because I am using docker, there is no need for me to have CUDA Toolkit or CuDNN on my...

GTK-Python Application Two Separate Processes

I have a simple Python 3 application and it uses GTK3 GUI. The application has an application ID and two separate processes are started when the application is started: 1) Main.py 2) test1 What...