this post was submitted on 08 Jul 2023
19 points (100.0% liked)

Python

6134 readers
15 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

October 2023

November 2023

PastJuly 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] CodeBlooded@programming.dev 3 points 1 year ago (12 children)

As an alternative to having to clean your Python environments, I’d like to suggest putting those efforts into mastering Docker. If you can master using Docker containers as your Python environment, you can cut through a lot of the pains regarding dealing with virtual environments, multiple Python installations, and the quasi-confusing PYTHONPATH environment variable.

I don’t even install Python on my machines anymore. I’m 100% “dockerized” and I’ll never go back.

[–] gnus_migrate@programming.dev 4 points 1 year ago (8 children)

This works great, assuming you're using Linux. On Windows this kind of a setup is a nightmare to maintain, since if something goes wrong you have to troubleshoot through several layers of virtualization and weird OS integrations to understand what's happening. Venv is a much better solution for that.

[–] qwop@programming.dev 2 points 1 year ago (1 children)

Yeah, my experience with docker on windows has been pretty bad, uses high CPU and RAM at the best of times, at the worst completely hangs my computer on 100% CPU usage forcing a restart as the only fix.

I really don't understand why people are overcomplicating this. You can install multiple Python versions at once on Windows and it just works fine (you can use the py command to select the one you want).

Virtual environments are designed exactly for this use case. They've got integrations for pretty much everything, they're easy to delete/recreate, they're really simple to use, they're fast, and they just work.

If virtual environments alone aren't quite enough you can use something like poetry or pipenv or the many other package management options, but in many cases even that is overkill.

[–] gnus_migrate@programming.dev 1 points 1 year ago* (last edited 1 year ago)

That matches my experience as well. Nothing kills a developers motivation like spending time dealing with and debugging weird failures on their dev environments as opposed to actually working on the things they care about.

load more comments (6 replies)
load more comments (9 replies)