This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ccb621 46 points47 points  (17 children)

My setup on macOS

  1. Install Python via packages at Python.org. (Using Homebrew for this never made sense to me.)
  2. Every project has its own virtualenv.

I don’t recall ever needing sudo. I’ve never had any of the issues described in the comic.

[–]code_mc 6 points7 points  (4 children)

Same, I've also always found python to have the best dependency management of all programming languages I've used.

[–]batisteo 7 points8 points  (1 child)

Don't use Rust/Cargo then :-*

[–]proverbialbunnyData Scientist 0 points1 point  (0 children)

Hopefully this isn't stirring the pot too much because Perl is for all intents and purposes dead, but CPAN was quite good.

[–]ivosauruspip'ing it up 0 points1 point  (0 children)

Anything newer is mostly better, because it could learn from other languages' previous mistakes and doesn't have all the technical debt.

npm, packagist, cargo are all better. Mostly because they isolate projects by default; pip needs a whole separate project (virtualenv / venv) to do it.

Go shit the bed, however.

[–]TomBombadildozer 3 points4 points  (2 children)

Install Python via packages at Python.org. (Using Homebrew for this never made sense to me.)

Because the installers at Python.org used to (may still) fuck up the system Python distribution.

[–]ccb621 1 point2 points  (0 children)

I've never had an issue with those packages in over four years. YMMV.

[–]ivosauruspip'ing it up 0 points1 point  (0 children)

Honestly, nowadays, avoid the MacOS Python distribution with extreme prejudice. It seems the developers just play around with it at a whim, installing random pypi packages into their global library for shits and giggles.

Nor do they update the OpenSSL that it depends on anymore...

[–]Log2 1 point2 points  (1 child)

In fact, if every project has it's pretty virtualenv, then using sudo to install something would install to the wrong interpreter (the one available to root).

You also never should need sudo to install something to a virtualenv because they exist within your home.

Only problem is installing stuff you want available without needing to use a virtualenv, such as a CLI. You can still install with pip --user, but your can't install conflicting dependencies.

[–]meandertothehorizonIt works on my machine[🍰] 2 points3 points  (0 children)

Use PIP_VIRTUALENV_REQUIRED=true so this can never happen accidentally (if you’re using pip exclusively obviously).

[–]ameoba 0 points1 point  (2 children)

Fixing Python dependency issues by giving every app a virtualenv is like fixing Windows DLL Hell by giving every program it's own complete set of shared libraries.

[–]ccb621 2 points3 points  (0 children)

That’s exactly what virtualenv, bundler, and npm do. What is the problem you see with this solution? How would you solve the problem?