This article is a beginner-friendly guide on Python environments, exploring their essentials, types, and use cases, designed to equip readers with a thorough understanding of the Python environment landscape and the different tools suitable for a wide range of project needs.
Thank you for this series, it seems like poetry is your favorite. How do virtual environments actually solve the problem of "it works on my machine". When someone opens the python file, it automatically downloads the correct version of all the installed packages or something?
I think your series is aimed at civil and structural engineers, so could you name, in your opinion, the best environment managing program for that purpose?
In the opening section about libraries, packages, and modules you have mixed your metaphors. Are libraries the books on a library, not the library itself (they're called libraries after all)? Also you say a module is a book in the packages description, but you call modules chapters of a book in the modules description. Perhaps you could give a more detailed description on how the three things relate or interact with each other.
Michael, thanks for the comment. You're correct about the confusion of that analogy. I cleaned it up to clarify. Regarding the best env management approach for engineers, my go-to choice for a long time was pip and venv (see https://docs.python.org/3/library/venv.html). I suggest you start with this; it's the most straightforward.
Poetry is a more robust tool that becomes valuable as you scale up the complexity of your Python projects. It has many useful quality-of-life features that are not apparent until you are working on multiple different projects along a longer time scale, where package management can become tedious. It also has some nice space-saving features. I'm still getting used to it, will talk about it more in the future.
Glad it's of some use. Your comment prompted me to add a brief update note to the article. Now I use astral uv for all of my Python project management needs (environments, packages, python versions etc.). I highly recommend it (https://docs.astral.sh/uv/).
Great to hear this stuff is consolidating for you. Once you wrap your head around the topic of environment management, things become much easier to build, maintain and organize.
You may find these articles as good next steps for where you're at:
#044 - Python Environments, Again | uv: A Guide to Python Package Management
Hi James,
Thank you for this series, it seems like poetry is your favorite. How do virtual environments actually solve the problem of "it works on my machine". When someone opens the python file, it automatically downloads the correct version of all the installed packages or something?
I think your series is aimed at civil and structural engineers, so could you name, in your opinion, the best environment managing program for that purpose?
In the opening section about libraries, packages, and modules you have mixed your metaphors. Are libraries the books on a library, not the library itself (they're called libraries after all)? Also you say a module is a book in the packages description, but you call modules chapters of a book in the modules description. Perhaps you could give a more detailed description on how the three things relate or interact with each other.
Thank you again,
Michael
Michael, thanks for the comment. You're correct about the confusion of that analogy. I cleaned it up to clarify. Regarding the best env management approach for engineers, my go-to choice for a long time was pip and venv (see https://docs.python.org/3/library/venv.html). I suggest you start with this; it's the most straightforward.
Poetry is a more robust tool that becomes valuable as you scale up the complexity of your Python projects. It has many useful quality-of-life features that are not apparent until you are working on multiple different projects along a longer time scale, where package management can become tedious. It also has some nice space-saving features. I'm still getting used to it, will talk about it more in the future.
Thanks for the reply! I will check out that link.
That's brilliant news @geek! π
Glad it's of some use. Your comment prompted me to add a brief update note to the article. Now I use astral uv for all of my Python project management needs (environments, packages, python versions etc.). I highly recommend it (https://docs.astral.sh/uv/).
Great to hear this stuff is consolidating for you. Once you wrap your head around the topic of environment management, things become much easier to build, maintain and organize.
You may find these articles as good next steps for where you're at:
#044 - Python Environments, Again | uv: A Guide to Python Package Management
https://flocode.substack.com/p/044-python-environments-again-uv
#051 - Simplify your Python Project Setup | Cookiecutter
https://flocode.substack.com/p/simplify-your-python-project-setup
James π