PIP无法从unignts.txt安装所有软件包

发布于 2025-01-30 12:57:36 字数 741 浏览 1 评论 0原文

我创建并维护一个软件包 seg-metrics 。但是我发现当我使用pip install seg-metrics安装它时,我无法安装其所有依赖项,即使我已经将所有必要的依赖项都包含到 insuert.txt

您能告诉我为什么以及如何解决它吗?

您可以尝试将其复制到自己的PC中。

  1. conda create -n test_env python = 3.8 pip#安装pip and
  2. pip install section seg-metrics#安装软件包
  3. pip列表#显示了已安装的软件包,您可以看到seg-metrics,但是您看不到以下依赖项,例如:simpleitk and Medutils 。可以通过以下命令来验证这。
  4. python#输入python解释器
  5. 导入seg_metrics.seg_metrics在此处发生SM#错误!

I created and maintain a package seg-metrics. But I found that I can not install all of its dependencies when I use pip install seg-metrics to install it, even though I have already included all necessary dependencies into the requirements.txt.

Can you tell me why and how to solve it?

You can try to reproduce it into your own pc.

  1. conda create -n test_env python=3.8 pip # install pip as well
  2. pip install seg-metrics # install the package
  3. pip list # shown the installed package, you can see seg-metrics, but you can not see the dependencies like: SimpleITK and medutils. This can be verified by the following commands.
  4. python # enter the python interpreter
  5. import seg_metrics.seg_metrics as sm # Error occured here !!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

满栀 2025-02-06 12:57:36

多亏了@phd,我发现我应该在setup.py中设置install_requires。之后,这个问题已解决。

Thanks to @phd, I found that I should set install_requires in setup.py. After that, this issue was fixed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文