#π pip vs poetry vs pdm vs any other package manager (for flask)
31 messages Β· Page 1 of 1 (latest)
@bleak epoch
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
pip and poetry/pdm are very different things,
poetry and pdm are dependencies manager that both use pip for installing stuff (poetry is also an environment manager)
you basically dont really have neither a dependencies manager nor an environment manager if you just use pip
so what i'd recommend is either use poetry or pdm/pnpm with virtualenv/pyenv
(nvm from what i see pdm also includes pyenv so its very similar to poetry)
Yea, currently I m doing it manually using pip.
Which is more compatible for Flask + Angular ?
So I need to just manage the dependencies, I don't want to migrate everything
there's no such thing as "more compatible" or not,
your flask project will work just fine with whichever one you use
having a dependencies manager over pip allows you to have a configuration of the dependencies needed by your project which you can use on another system or when deploying it
and poetry/pdm also allow you to have an isolated virtual environment so that your system python don't get polluted with dependencies that are unique to this project
basically, you have your main system python, and little forks of it which are isolated for each project on your system so they don't fight each other
I already have isolated virtual environment, created using docker.
My main goal is to just maintain the dependencies, without making any other changes
well if your project is in a docker container, it's fine to simply use pip, but i'd advice you to pip freeze in a requirements.txt file so that you can pip install -r requirements.txt in your Dockerfile
i also use poetry when working with docker but that's simply out of habit
Yea, right now that's how I am doing it. But while researching I heard that it's better to use package manager
little tip with working with requirements.txt : instead of having static versions, you can use version specifiers
well poetry, pdm or pnpm are better, but you don't have to use them either
the main advantage of using them is having an isolated and reproducible environment
but docker already covers both
if someday you'd like to instanciate your project out of docker, having a dependency manager would be good though
Ohhh, if my understanding is correct, ideally in my case I don't need dependency manager?
while you do everything in docker, no you don't
Thanks mate
!pip pip-tools or uv should be used if you go with just pip. It can ensure your pinned dependencies are up to date.
pdm can also create a requirements.txt automatically via ```toml
[tool.pdm.scripts]
post_install = "{pdm} export --self --prod --without-hashes -o requirements.txt"
poetry too
poetry export --without-hashes -o requirements.txt
But poetry doesn't have a feature to run it automatically afaik
na, but you can add that to have it done
https://github.com/Ddedalus/poetry-auto-export
Automatically create requirements.txt on every poetry lock - Ddedalus/poetry-auto-export
(in docker he can simply add the export command after installing though)
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.