Hacker News new | ask | show | jobs
by flembat 529 days ago
Write your python, run script, find missing import. Install missing import, find that you actually need a different version of python as the import does not understand the latest version yet. Find that the import depends on various other imports, which python and the package manager, does not tell you it needs. Downgrade your local python. (and lets not discuss managing multiple versions.) Import library again and find you need to install a C compiler. Install a c compiler. Later find that the library is not compatible with your systems version of openssl. And it turns out you now need a version of python that has some extra static code linked into it, because you need to display a simple GUI. But you still need the GUI library as well.
2 comments

I don't like to respond to people who directly reply to my comments to avoid flame wars. But, about your comment: THIS.

Python can be convenient, but often isn't. Just setting the path on my last install was annoying because Python got automatically installed by windows in a hard-to-find folder.

BASIC "just worked".

Yeah, but did BASIC have an SSL library?

The bar for "basic" programming these days is much higher in many cases.

There is no question Python is a lot more useful and relevant to modern software development. Arguably a better language for many use cases.

The question is whether someone learning fundamental programming needs to use a language with SQL support. I think that BBC basic or quick basic are better choices for learning, but that's me. Also, BASIC has gorilla.bas :)

>The question is whether someone learning fundamental programming needs to use a language with SQL support.

They aren't going to run into any of the issues you describe, either, because they won't need third-party libraries and should be learning fundamentals of programming before trying to make a GUI. But in the cases where someone reaches that point and is trying to use, say, the system Python on a Debian-based Linux distro, the solution is generally an Apt invocation away.

>Write your python, run script, find missing import.

This is not a reasonable comparison, because in the ROM BASIC days there was nothing available to import in the first place. (Nor were you going to be making a GUI, and this was around 15 years before the first public release of OpenSSL. Nor was your language implementation versioned, therefore it never got any new functionality.)

The rest is FUD.

You don't "install imports" in the first place; you install packages - and they absolutely do tell you what their dependencies are. Encountering issues caused by the python version is relatively rare, especially because relatively few people are proactively upgrading Python to the latest version anyway. There is no such thing as "the package manager"; you have options. The default package installer automatically resolves dependencies, and so do its alternatives. Python installations don't generally upgrade or downgrade; you're meant to install multiple versions, and managing multiple versions is easy. You just have to understand environments, which you have to do in order to do any serious development in any programming language ecosystem where you're dependent on versioned third-party packages. Importing a library would never be the cue that you "need to install a C compiler"; you would find that out from a failed attempt by the package installer to automatically build the package for you. When you find yourself in that position, the default workflow is to go politely bug the package maintainers to prebuild it, or at least try to find out why your system is so special that they can't prebuild it. If you're having OpenSSL compatibility issues, you're probably either trying to run a version of Python that's no longer supported, or trying to run current Python on a system that's no longer supported. If you're having issues with TKinter, please read https://stackoverflow.com/questions/76105218 (I am the author). It's completely reasonable that you need both the C and Python parts of TKinter to make it work, because the entire point of the Python part is to interface to the C for you so that you don't need to understand the C FFI. But also, having this code automatically is the norm.

Well I was describing what I actually experienced last week. I did get my script to work after hours of faffing around, your article may have been one of the articles I read, in any event thanks for writing it. There is no way I would describe the package installation process I experienced as automatic, since pip had no idea what requirement was missing. Python was in an environment, a package used by an import statement required it to be downgraded so I had to downgrade it, by finding installing and setting up an older version. I then ran into other problems I described. Once python is set up and working it seems fine. Everything new I do in python seems way harder than it should be.

As for basic in ROM, I am not advocating BASIC, but many versions of BASIC (not in rom) have had built in support for GUIs for decades.

What packages were you trying to install, on what platform?
I needed transformers to talk to a local copy of Qwen, and a GUI, using tkinter on macos intel ventura. It all worked eventually. I have not got the AMD GPU to work yet. I don't hold python in anyway responsible for the GPU problem. There was some issue with urllib, and it still complains that my numpy is the wrong version. Its all ok.