TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Venv, virtualwrapper, pipenv, poetry, pdm, oh my

19 点作者 p33p将近 3 年前
Dependency and package management has seen a lot growth and attention in the Python community even in the last couple years. Everyone has their opinions on what to use, but for enterprise code bases, what is the recommended approach?<p>Ideally responses would include size of user base, number of package dependencies, any issues arisen, etc.<p>Thanks y’all. Needless to say, the most recent pipenv post on the front page has led to more confusion than I’d like to admit.

9 条评论

akagusu将近 3 年前
Unfortunately, there is no official way to handle dependencies in Python projects.<p>You should use what is best for you and the only way to find it is to try all of them.<p>If you find this a mess, it is because it is.<p>Python dependency management is a mess and it seems it will not get better any time soon, unfortunately.<p>This is because none of them are good enough.<p>There is a trend towards Poetry right now, and people seem to like it, but there are also people that complain it is not the right tool for some kind of projects. It deserves a try.<p>I tested PDM but it follows an different approach that Python community is used to and because of this it does not get the same attention as other tools.<p>Pipenv was a tool with lots of promises that got aggressively marketed as the &quot;official&quot; way to manage Python dependencies but it failed to delivery its promises and it seems the community moved from it.
speedgoose将近 3 年前
I ignore these and go straight to software containers (docker, podman, kubernetes,…) because my hammer works well.
评论 #32121611 未加载
roflchoppa将近 3 年前
We use `pyenv` in order to manage python installations (it helps when you want to test different versions manually installing and managing can be done too but is a pain)<p>We force the use of `virtualenv` so that within our project we can nuke and rebuild the installed dependencies quickly.<p>There are multiple requirements.txt files, the first one that used for installation installs the pined version of `pip`, and `setuptools`.<p>After that additional dependencies are installed (separate file).<p>One of the senior engineers I used to work with wanted me to checkout `pip compile`. It looks useful.
bravetraveler将近 3 年前
It&#x27;s a mess in general<p>The best balance I&#x27;ve managed is with Linux - distributions bundle up most everything I need as packages, and I&#x27;m lucky there&#x27;s very little requirement for specific versions for what I need<p>Anything extra I tend to get with pip&#x2F;--user
PrivateButts将近 3 年前
We&#x27;ve been using pipenv + pyenv at work for years, and it&#x27;s fine to be honest. On Linux, I don&#x27;t really have a problem with either tool anymore, on Windows it&#x27;s still a bit buggy. Most of it comes from the pipenv pyenv integration not working automatically. I&#x27;d try a couple and find what works best for your workflow.<p>Not saying python package management couldn&#x27;t be better, but I think that a lot of pipenv&#x27;s hate comes from earlier versions, and is a bit overblown.
评论 #32121356 未加载
laerus将近 3 年前
For development, poetry is the most user friendly tool and it&#x27;s also battle tested. For application deployment&#x2F;installation pipx &quot;just works&quot; and it&#x27;s an official PyPA project inspired by npx.<p>I don&#x27;t know why people are saying it&#x27;s not going to get better but there is an ongoing effort to actually become better but as with everything it goes through the PEP process which is a slow.
Kaze404将近 3 年前
I don’t personally write Python often, especially not in an enterprise context, but from my (admittedly narrow) understanding all these tools try to do what Nix already does. You could look into that.
评论 #32121559 未加载
aristofun将近 3 年前
Python devx has always been a mess. Unfortunately.
mejutoco将近 3 年前
pipenv install, pipenv lock and docker installing the lock file with pip.<p>Never had to think about which virtual environment I am using again.