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.
This article was exactly what I needed! Iβve been struggling to understand Python environments, especially with the whole global vs. virtual environments debate. I always ended up mixing my projects and facing issues with dependencies and versions. After reading this, everything just clicked! The clear breakdown of modules, packages, and libraries was super helpful, and I now feel much more confident in managing my environments properly.
I used to feel overwhelmed, but this guide made it much simpler to grasp. I especially appreciated the advice on using virtual environments to avoid messing up my global setup. It saved me from making the same mistakes I did before.
For anyone facing similar issues, I also found this [install miniconda ubuntu](https://docs.vultr.com/how-to-install-miniconda-on-ubuntu-24-08) guide helpful when setting up my environment. Highly recommend this article β itβs a must-read! Thanks for putting this together!
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.
This article was exactly what I needed! Iβve been struggling to understand Python environments, especially with the whole global vs. virtual environments debate. I always ended up mixing my projects and facing issues with dependencies and versions. After reading this, everything just clicked! The clear breakdown of modules, packages, and libraries was super helpful, and I now feel much more confident in managing my environments properly.
I used to feel overwhelmed, but this guide made it much simpler to grasp. I especially appreciated the advice on using virtual environments to avoid messing up my global setup. It saved me from making the same mistakes I did before.
For anyone facing similar issues, I also found this [install miniconda ubuntu](https://docs.vultr.com/how-to-install-miniconda-on-ubuntu-24-08) guide helpful when setting up my environment. Highly recommend this article β itβs a must-read! Thanks for putting this together!
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 π