Hacker News new | ask | show | jobs
by mmh0000 874 days ago
I really dislike Python.

This is a clean install of Python straight from the Python developers in a clean container. And it doesn't work. I figured I must need "points" so I pip-installed that.

Feels like every time I try to use Python, stupid, incomprehensible errors such as this occur:

```

  root@1623eb794014:/# ./tri.py
  Traceback (most recent call last):
    File "//./tri.py", line 6, in <module>
      from points import Point, Block
  ImportError: cannot import name 'Point' from 'points' 
  (/usr/local/lib/python3.12/site-packages/points/__init__.py)
```
3 comments

That's because the points package [1] (which is a dead project) doesn't have a Point class. The code in the article is probably referring to their own custom module that they never shared. No programming language lets you import code that only exists on somebody else's hard drive.

[1] https://pypi.org/project/points

From the article:

> this code is shared to show the algorithm, not as a drop-in application that just runs. It depends on two private modules configmanners and Points. Both of these are on github

I don't know why you would find this so confusing, or blame Python. The author literally explains that the points module is not on pip. You installed some random pip package and expected it to replace a different dependency.

In this case it’s the fault of the author in either not including all the source code, or having undocumented dependencies
Was this note at the bottom not there earlier? It seems to me like a clear enough disclaimer.

Please note: this code is shared to show the algorithm, not as a drop-in application that just runs. It depends on two private modules configmanners and Points. Both of these are on git hub, but to put them upload them to pip would be to commit to supporting them in perpetuity. I'm not willing to do that.

The author explicit mentions it twice.
This is a valid criticism of the Python community and something the core language maintainers should look to address.

Working in Python in the 2000s, I was extremely happy. Working in Python (especially ML and data science applications) in the 2020s is a nightmare. The world has come a long way, and Python has actually taken a backslide.

Python would do well to learn from the Rust project and their Cargo package manager and tooling.

> This is a valid criticism of the Python community and something the core language maintainers should look to address.

The author didn't include one of his custom source libraries that's not needed to understand the code, so that makes this a valid criticism of the Python community? lol

One million percent yes.

The code shouldn't build, go green, or be in any shareable state. This is horrifically bad practice.

A language should remove all of these thorns in a first-class manner.

Until you use a package manager like Cargo, you probably can't intuit the wide gulf here. A good analogy might be imagining the world before version control.

Dependency control matters immensely. Hermeticity and repeatability matter immensely. We should strive to build these into the very foundations.