admin管理员组文章数量:1123086
Suppose I have a python venv with package A installed that depended on package B. B is currently version 1.0.0 and over the course of several months or years newer versions comes out, say, B 1.0.1, 1.0.2, ..., 1.1.0, etc.
If I install another package C that also depends on B, then the version of B I currently have installed (1.0.0) is untouched if it meets C's requirements. However, if the very latest version of C depends on >=B 1.1.0, then "pip install C" will also replace B 1.0.0 with whatever is the latest B 1.1.x, and potentially breaking A.
What's considered the best practice for handling this sort of thing?
At the moment I tend to first install new packages to a different location using a different non-privilege user and look out for error messages saying that it's unable to uninstall B 1.0.0, at which point I examine the requirements of all the packages this might impact on (e.g. running pipdeptree to get an overview for the dependencies of other already installed packages), and if necessary, try a slightly older version of package C that still supports B 1.0.x. Then once I'm sure any dependency issues been sorted, I reinstall C into the main package location using the main user account for that.
But this seems a bit laborious, and I'm wondering if there are better way to do this.
本文标签:
版权声明:本文标题:What is the Python package installation best practice to not break other already installed packages? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736546446a1944453.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论