github源的PIP安装无法安装在存储库中定义的依赖项.txt
我正在尝试完全安装 github存储库在我的包装中。该项目被正确添加到我的setup.cfg
文件:
install_requires =
requests>=2.27.0, <3.0.0
rich>=12.3.0, <13.0.0
pydantic>=1.9.0, <2.0.0
openalexapi @ git+https://github.com/dpriskorn/OpenAlexAPI.git@master#egg=openalexapi
a pip install -e。
installs openalexapi
,但它不会吸引依赖项列表在他们的要求中。因此,它无法安装向后
并返回以下错误:
Python 3.10.0 (default, Oct 7 2021, 04:19:18) [Clang 10.0.0 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from openalexapi import works
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 from openalexapi import works
File ~/codes/PPPL/promotion-analysis/venv/lib/python3.10/site-packages/openalexapi/__init__.py:7, in <module>
4 import logging
5 from typing import Optional, List
----> 7 import backoff # type: ignore
8 import requests
9 from pydantic import BaseModel, EmailStr
我知道一个人可以做pip install -r https://path/to/requirements.txt
但是想知道是否有一种方法可以自动触发依赖关系。
I'm trying to fully install a Github repository in my package. The item is added properly to my setup.cfg
file:
install_requires =
requests>=2.27.0, <3.0.0
rich>=12.3.0, <13.0.0
pydantic>=1.9.0, <2.0.0
openalexapi @ git+https://github.com/dpriskorn/OpenAlexAPI.git@master#egg=openalexapi
A pip install -e .
installs openalexapi
but it does not pull the list of dependencies in their requirements.txt. As such, it fails to install backoff
and returns the following error:
Python 3.10.0 (default, Oct 7 2021, 04:19:18) [Clang 10.0.0 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from openalexapi import works
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 from openalexapi import works
File ~/codes/PPPL/promotion-analysis/venv/lib/python3.10/site-packages/openalexapi/__init__.py:7, in <module>
4 import logging
5 from typing import Optional, List
----> 7 import backoff # type: ignore
8 import requests
9 from pydantic import BaseModel, EmailStr
I know that one can do pip install -r https://path/to/requirements.txt
but was wondering if there is a way to trigger pulling the dependencies automatically.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当不明确时(
pip install -r unignts.txt
)问pip install
永远不要隐式使用supports.txt
。依赖项在
setup.cfg
/setup.py
中列出在车轮的元数据或源分布中。顺便说一句说元数据是从setup.cfg
/setup.py
中生成的,必须明确读取supports.txt
。openalexapi
代码并非如此When not explicitly (
pip install -r requirements.txt
) askedpip install
never implicitly usesrequirements.txt
.Dependencies are listed in wheels' metadata or in source distributions in
setup.cfg
/setup.py
. And BTW said metadata is generated fromsetup.cfg
/setup.py
which must explicitly readrequirements.txt
.It's not the case with
openalexapi
code so the only way to use itsrequirements.txt
is to do explicitly