上游 pip 依赖导致 pip 安装失败
我正在尝试解决 pip
包中阻止构建 Dockerfile 的错误,并且我想更好地了解 pip
正在做什么。
问题:
当我执行 pip install -rrequirements.txt
时,它会继续安装包含 pathlib
的需求,即使它不在requirement.txt内 >。
这让我相信 pip 正在执行依赖项解析并找到 requests.txt 中的包,尝试安装它,然后失败,因为它尝试安装的 pathlib
不包含 read_text
与 PosixPath
类(因为在 v3.5 中将 pathlib 添加到 python 之后添加了该类)。
问题:
- 如何查看哪个包具有 pathlib 作为依赖项?
- 有没有办法阻止 pip 安装上游依赖项?
I’m trying to resolve a bug within a pip
package that’s preventing a Dockerfile from getting built and I'd like to better understand what pip
is doing.
Problem:
When I do a pip install -r requirements.txt
it proceeds to install the requirements which includes pathlib
even though that’s not within requirement.txt.
This leads me to believe that pip is doing dependency resolution and finding a package that is within requirements.txt, attempting to install it, and then failing because the pathlib
it is trying to install does not contain read_text
with the PosixPath
class (since that was added later after pathlib was added to python in v3.5).
Question:
- How can I see which package has pathlib as a dependency?
- Is there are way to prevent pip from installing an upstream dependency?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论