r/learnpython • • Nov 27 '22

This is why I hate programming

It invarably happens, whenever I try to start a new VERY simple project that either python complains about something or Linux complains, or spyder complains, or who knows who might complain about something being wrong. Then I end up spending the next hour pouring over google search results trying to find ANYONE who has had this problem before. I find, and try half a dozen different 'fixes' that none of them work and I end up tearing my hair out.
Then I end up here, begging anyone to solve my problem.

I wanted to write a simple little script that would play audio files. I found one named AudioPlayer that seems to suit my needs. I install the module and write about a dozen lines of code, and run it only to be prompted with 'No module named 'gi''.

Funny, I don't recall ever asking for a module named gi before, regardless, the file refuses to play.

again, I pour thru google search results trying to find a solution, to no avail. I've tried half as dozen (or more) different 'solutions' without success.

I am running anaconda on Ubuntu with Python 3.9.12.

Does anyone have an idea how I can solve this?

3 Upvotes

42 comments sorted by

View all comments

5

u/[deleted] Nov 27 '22

Link to the library you're trying to use: there are many projects called "AudioPlayer". I'll see if I can replicate the problem on my system.

2

u/Radamand Nov 27 '22

https://pypi.org/project/audioplayer/

from audioplayer import AudioPlayer

Traceback (most recent call last):
File ~/MusicLibraryCleanupTool.py:8 in <module>
from audioplayer import AudioPlayer
File ~/anaconda3/lib/python3.9/site-packages/audioplayer/__init__.py:12 in <module>
from .audioplayer_linux import AudioPlayerLinux as AudioPlayer
File ~/anaconda3/lib/python3.9/site-packages/audioplayer/audioplayer_linux.py:7 in <module>
import gi
ModuleNotFoundError: No module named 'gi'

0

u/[deleted] Nov 27 '22

[deleted]

0

u/Radamand Nov 27 '22

sudo apt-get install python-gst-1.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python-gst-1.0
E: Couldn't find any package by glob 'python-gst-1.0'
E: Couldn't find any package by regex 'python-gst-1.0'