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

16

u/KimPeek Nov 27 '22

Bit of reality for you: programming probably isn't the best activity to spend your time on if you get this frustrated from a problem. Programming is largely a cycle of trying to do something, being interrupted by a problem, working to overcome that problem, then continuing to the next problem. You may hate that, and that's completely fine. Some of us enjoy problem solving, but it's well established that programming can be frustrating and is not for everyone.

-3

u/Radamand Nov 27 '22

no, I enjoy solving problems, when they are solvable! going on 2 hours now for a simple library import is ridiculous!

6

u/LeeRyman Nov 27 '22

Getting gstreamer and its python introspection libraries working can be a little unintuitive, because you're often mixing installation of required distro packages with required wheels, and hoping the dependencies are correct and fulfilled.

This is definitely a situation where I'd be taking a break, have a ponder about how to troubleshoot the problem differently and try again.

2 hours on a more-complex integration problem is nothing. A fresh look might rule out silly issues like system vs venv environments, different python versions, different GST versions, etc.

2

u/[deleted] Nov 27 '22

Most problems are solvable. Sometimes they are problematic and take a lot of time, but generally, that gets better with more learning/experience.

Reading the error messages and interpreting them is an essential skill that gets easier with more experience. Don't give up, and learn to explain to the rubber duck. It really helps a lot: https://en.m.wikipedia.org/wiki/Rubber_duck_debugging

3

u/WikiSummarizerBot Nov 27 '22

Rubber duck debugging

In software engineering, rubber duck debugging (or rubberducking) is a method of debugging code by articulating a problem in spoken or written natural language. The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, line-by-line, to the duck. Many other terms exist for this technique, often involving different (usually) inanimate objects, or pets such as a dog or a cat.

[ F.A.Q | Opt Out | Opt Out Of Subreddit | GitHub ] Downvote to remove | v1.5

2

u/Explicit_Pickle Nov 27 '22

They're solvable. It can be frustrating starting out but the more you put into it the more the problems will get more and more interesting, but always solvable

2

u/Boohoolean Nov 27 '22

EVERY problem in life is solvable in one way or another. Perseverance and ingenuity are key.