Erik_
Python environment rant
Sun Jul 10, 2022 1:23am

So, Ubuntu came with Python 2.7 installed on it when I first installed the OS way back however many years ago that was. Somehow, I managed to mangle up the "pip" package manager to the point where it would just crash out whenever I tried to use it. I ended up installing Python 3 as everyone says to avoid using 2.7 due to it being obsolete.

No worries, Python3 installed and worked fine. (This was around the time of the DiscApp imports when we first switched over). That pip package manage also died on me and just threw up a stack trace error whenever I tried to use it.

Even trying to update it or reinstall it on either version didn't work.

I eventually got fed up and went scorched Earth on it and "rm -rf" the dirs on the hard drive related to anything Python. Then, I downloaded the latest version fresh from their website and built the source. Didn't see any errors at the end of the "make" so I went "make install".

Hey! It seemed to actually work! Then I went to use pip to install a DB library I needed to test my import script changes. NOPE! Broke again but this time because it wasn't built with support for HTTPS. Yay...

Tracked that down to needing some openssl packages installed (which I thought I had..?). Installed those and tried again. Found at towards the top of the "make" build output (that flies by at 1000MPH) That it wasn't found and therefore skipped.

I installed the package and tried again.

This time, the version wasn't new enough so it also skipped building HTTPS support into pip.

I ended up picking a version a few back from the current and tried that. That ACTUALLY built with the openssl lib without issues. I was able to use pip and install the package I needed for postgres DB and test my import script changes.

Holy crap. What an absolute nightmare. I can't remember the last time I've had issues like this setting up a programming language on my computer. Even building the COBOL compiler from source is a piece of cake. It reminded me of being back in 2002 playing around with Slackware Linux on my PII 233MHz computer and fighting to build every package with and manage all the dependency versions manually again.

Granted, on Windows and potentially Mac (which I'm guessing most Python users are on) they probably have a binary download that just "works" out the box... but still... I haven't had this issue with any other language before on this computer.

I also busted up my Python install on my old work Windows 7 PC now that I think about it too!

Everyone these days loves Python but honestly, I always preferred Perl as my scripting language of choice. Thankfully at my job I get to write a decent amount of Perl still where the rest of the world has forgotten about it.

</rant>


    • Octoprint is now requring Python 3 - Puckdropper, Sun Jul 10 2022 3:02am
      Their instructions are "you're best off just saving your settings and reimaging the drive with the latest OS image." It's so nice to grab the binary and go or get the installer and have things done in 2-3 minutes. I've tried switching to Linux and have given it a good shot but keep coming back to... more
      • I was debating actually going that route too. - Erik_, Mon Jul 11 2022 4:51pm
        The version of Ubuntu I'm running is 16.04 which is EOL. I've been putting off upgrading to the latest version for a while now and if I couldn't get this going, it might have been enough to get me to finally do it. It definitely would have been easier to just start fresh and have everything work... more
        • Didn't you upgrade as things went along? - Puckdropper, Fri Jul 15 2022 4:22am
          Where Windows gets it wrong is you're dragged, kicking and screaming, to the next update. Still don't remember where I was, it decided to reboot after updates on me and I'm back to an empty desktop. DOES NO ONE UNDERSTAND HOW STRESSFUL IT IS TO FIND ALL YOUR STUFF GONE? "OH, WE SAVED IT." YEAH,... more
          • from 16.04. Desktop support ended in 2021. I remember other installs getting a "dist upgrade" but maybe because this was a LTS version it didn't? Not sure. "it decided to reboot after updates on me and I'm back to an empty desktop." Ugh, yeah, I don't miss that at least. My Mac does it but... more
            • Maybe you didn't issue the magic commands? - Puckdropper, Tue Jul 19 2022 2:56am
              dist upgrade dist update dist upgrade dist update-from-releases dist update dist upgrade dist thing -nvrwrks That sounds totally plausible about it being a LTS. It sure does suck when your OS upgrade messes up a piece of hardware. Just because 99.9999% of the world doesn't use the cue cat,... more
              • You're probably right. - Erik_, Tue Jul 19 2022 9:33am
                That or I didn't fully read the output of it when I did. Good to know I'm not the only one that goes through spamming those commands. Same goes for apt sometimes as well. Speaking of apt and auto updating stuff. Ubuntu has been pushing "snaps" instead of the old "apt" way of doing things the past... more
                • You're welcome to use some of my system resources - Puckdropper, Mon Jul 25 2022 2:22am
                  It's just like visiting my house. Sure, wash your hands in my sink. Don't store your junk in my living room, though. Use my resources but don't abuse them. 6 GB free? You gotta clear your logs, man! That'll free up at least another 10 GB. Sometimes I think we need to stop isolating programmers... more
                  • I just cleaned up another 5GB from hidden files - Erik_, Tue Aug 09 2022 10:44am
                    From versions of software I don't have installed anymore. There's a few more gigs I could clear up if I cleaned out the ~/.cache dir but I'm not sure if anything will blow up if I do that. I agree about leaving things as you came. This drive is full of trash that's accumulated over the years and... more
                    • But it's LINUX! IT DOESN'T NEED PERIODIC REINSTALLS!!!!1oneo - Puckdropper, Wed Aug 10 2022 2:18am
                      Wow, 500 MB of Perl stuff just for one package manager. Sometimes I think they just don't ever look at how much they're accumulating. That would be interesting, if you had a spare drive to copy your install to. Just blow out the ~/.cache dir and see what happens. It'd be interesting to see what... more
"Forces act when not restrained" - Puckdropper