5 ms·
re: virtual environments - Getting back to learning Python myself, started with `Pipenv`, but recently stumbled across Poetry. Recommendations on one vs the oth
by spelunker 3y ago
re: virtual environments - Getting back to learning Python myself, started with `Pipenv`, but recently stumbled across Poetry. Recommendations on one vs the other?
- claytonjy 3y agoDefinitely poetry; pipenv is not actively maintained and poetry is it's spiritual successor.
- gv83 3y agoDefinitely not, pdm is better behaved and less prone to random breaking changes
- KolmogorovComp 3y agoPoetry. Pipenv has a very bad reputation and most new projects that needs a more robust tooling than a simple “requirements.txt” use it. This is also confirmed by my own experience.
- gv83 3y agoPoetry is not stable at all. pip-tools all the way, if not…pdm please
- nylonstrung 3y agoI've tried both and actually prefer PDM the most by far
- timeon 3y agoThere is also: https://github.com/mitsuhiko/rye https://github.com/mitsuhiko/rye
- shrimpx 3y agoPoetry is the way to go.
- savrajsingh 3y agoI'm a pyenv + virtualenv person and that's worked well for many years. But it sounds like I'll need to have ChatGPT explain Poetry to me... https://fathomtech.io/blog/python-environments-with-pyenv-and-vitualenv/ https://fathomtech.io/blog/python-environments-with-pyenv-an...
- nerpderp82 3y agoFind the "just right" packaging system will get someone nerdsniped, you can do that. Or you can do the commands below and get something running in 20 seconds using the built in tools. Nerdsnipe yourself later as an exercise. python -m venv myenv.env source myenv.env/bin/activate pip install -U pip setuptools wheel pip install ipython ipython<return> now repl away!
- gjvc 3y agothe ".venv/bin/activate" script is rarely useful outside blog posts. Instead, just have a "bin/run-main" script set PYTHONPATH to point to the source files in your project, then call '.venv/bin/python3 src/python/some/where/file/name.py "${@}"' to run it. YMMV. HAND. IANAL.
- tehnub 3y agoUnless I'm making a "project" that I want to eventually package into an application or library, I prefer to just use pyenv with venv. Pyenv lets me pick my Python interpreter which I then use in conjunction with venv to create a virtual environment. For example, creating a venv with Python 3.9: pyenv local 3.9 python -m venv my-env source my-env/bin/activate pip install [whatever I need]
- nerpderp82 3y agoJinx you owe me a coke.
- tehnub 3y agoFunny that we both formatted the commands and everything xD
- nerpderp82 3y agoAnd we joined at nearly the same time, have a similar HN "score" and have a similarly dorky handle. We complete us.
- ensignavenger 3y agoPersonally, I like Poetry over pipenv, but preferences will vary. There are some other alternatives currently fighting for mindshare, too. It will be interesting to see where the dust settles.
- spelunker 3y agoThanks for the input everyone. Clearly Python needs more tools lol
- deleted 3y ago[deleted]