找不到与Protobuf匹配的版本?

发布于 2025-02-03 11:54:06 字数 3205 浏览 1 评论 0原文

我需要使用此命令检查我的依赖项:

pipreqs ./myPorjectFolder --savepath requirements.in --force && pip-compile

此命令曾经工作正常。但是,我现在收到此错误:

INFO: Successfully saved requirements file in requirements.in
Could not find a version that matches protobuf<4.0.0dev,==4.21.1,>=3.15.0 (from -r requirements.in (line 4))
Tried: 2.0.3, 2.3.0, 2.4.1, 2.5.0, 2.6.0, 2.6.1, 3.0.0, 3.0.0, 3.1.0, 3.1.0.post1, 3.1.0.post1, 3.2.0, 3.2.0, 3.3.0, 3.4.0, 3.4.0, 3.5.0.post1, 3.5.0.post1, 3.5.1, 3.5.1, 3.5.2, 3.5.2, 3.5.2.post1, 3.5.2.post1, 3.6.0, 3.6.0, 3.6.1, 3.6.1, 3.7.0, 3.7.0, 3.7.1, 3.7.1, 3.8.0, 3.8.0, 3.9.0, 3.9.0, 3.9.1, 3.9.1, 3.9.2, 3.9.2, 3.10.0, 3.10.0, 3.11.0, 3.11.0, 3.11.1, 3.11.1, 3.11.2, 3.11.2, 3.11.3, 3.11.3, 3.12.2, 3.12.2, 3.12.4, 3.12.4, 3.13.0, 3.13.0, 3.14.0, 3.14.0, 3.15.0, 3.15.0, 3.15.1, 3.15.1, 3.15.2, 3.15.2, 3.15.3, 3.15.3, 3.15.4, 3.15.4, 3.15.5, 3.15.5, 3.15.6, 3.15.6, 3.15.7, 3.15.7, 3.15.8, 3.15.8, 3.16.0, 3.16.0, 3.17.0, 3.17.0, 3.17.1, 3.17.1, 3.17.2, 3.17.2, 3.17.3, 3.17.3, 3.17.3, 3.18.0, 3.18.0, 3.18.0, 3.18.1, 3.18.1, 3.18.1, 3.19.0, 3.19.0, 3.19.0, 3.19.1, 3.19.1, 3.19.1, 3.19.2, 3.19.2, 3.19.2, 3.19.3, 3.19.3, 3.19.3, 3.19.4, 3.19.4, 3.19.4, 3.20.0, 3.20.0, 3.20.0, 3.20.1, 3.20.1, 3.20.1, 4.21.0, 4.21.0, 4.21.0, 4.21.0, 4.21.1, 4.21.1, 4.21.1, 4.21.1
Skipped pre-versions: 2.0.0b0, 3.0.0a2, 3.0.0a3, 3.0.0b1, 3.0.0b1.post1, 3.0.0b1.post2, 3.0.0b2, 3.0.0b2, 3.0.0b2.post1, 3.0.0b2.post1, 3.0.0b2.post2, 3.0.0b2.post2, 3.0.0b3, 3.0.0b4, 3.0.0b4, 3.2.0rc1, 3.2.0rc1, 3.2.0rc1.post1, 3.2.0rc1.post1, 3.2.0rc2, 3.2.0rc2, 3.7.0rc2, 3.7.0rc2, 3.7.0rc3, 3.7.0rc3, 3.8.0rc1, 3.8.0rc1, 3.9.0rc1, 3.9.0rc1, 3.10.0rc1, 3.10.0rc1, 3.11.0rc1, 3.11.0rc1, 3.11.0rc2, 3.11.0rc2, 3.13.0rc3, 3.13.0rc3, 3.14.0rc1, 3.14.0rc1, 3.14.0rc2, 3.14.0rc2, 3.14.0rc3, 3.14.0rc3, 3.15.0rc1, 3.15.0rc1, 3.15.0rc2, 3.15.0rc2, 3.16.0rc1, 3.16.0rc1, 3.16.0rc2, 3.16.0rc2, 3.17.0rc1, 3.17.0rc1, 3.17.0rc2, 3.17.0rc2, 3.18.0rc1, 3.18.0rc1, 3.18.0rc1, 3.18.0rc2, 3.18.0rc2, 3.18.0rc2, 3.19.0rc1, 3.19.0rc1, 3.19.0rc1, 3.19.0rc2, 3.19.0rc2, 3.19.0rc2, 3.20.0rc1, 3.20.0rc1, 3.20.0rc1, 3.20.0rc2, 3.20.0rc2, 3.20.0rc2, 3.20.1rc1, 3.20.1rc1, 3.20.1rc1, 4.0.0rc1, 4.0.0rc1, 4.0.0rc2, 4.0.0rc2, 4.21.0rc1, 4.21.0rc1, 4.21.0rc1, 4.21.0rc1, 4.21.0rc2, 4.21.0rc2, 4.21.0rc2, 4.21.0rc2
There are incompatible versions in the resolved dependencies:
  protobuf==4.21.1 (from -r requirements.in (line 4))
  protobuf<4.0.0dev,>=3.15.0 (from google-api-core==2.8.1->google_api_python_client==2.49.0->-r requirements.in (line 2)

sumpliont.in引用的文件包含以下内容:

filelock==3.7.0
google_api_python_client==2.49.0
google_auth_oauthlib==0.5.1
protobuf==4.21.1
scipy==1.8.1
sentry_sdk==1.5.12

i 检查pypi ,显然,protobuf == 4.21.1在那里。

为什么这个问题会发生?

通常,我在Protobuf方面遇到了问题。

如果我没记错的话,pipreqs说我需要4.21.1,而是该软件要求它在4.0.0 和3.15.0?显然,这是一个无效的条件。

如何获得pipReqs需要校正版本,例如3.20.1

I need to check my dependencies with this command:

pipreqs ./myPorjectFolder --savepath requirements.in --force && pip-compile

This command used to work just fine. However, I am now received this error:

INFO: Successfully saved requirements file in requirements.in
Could not find a version that matches protobuf<4.0.0dev,==4.21.1,>=3.15.0 (from -r requirements.in (line 4))
Tried: 2.0.3, 2.3.0, 2.4.1, 2.5.0, 2.6.0, 2.6.1, 3.0.0, 3.0.0, 3.1.0, 3.1.0.post1, 3.1.0.post1, 3.2.0, 3.2.0, 3.3.0, 3.4.0, 3.4.0, 3.5.0.post1, 3.5.0.post1, 3.5.1, 3.5.1, 3.5.2, 3.5.2, 3.5.2.post1, 3.5.2.post1, 3.6.0, 3.6.0, 3.6.1, 3.6.1, 3.7.0, 3.7.0, 3.7.1, 3.7.1, 3.8.0, 3.8.0, 3.9.0, 3.9.0, 3.9.1, 3.9.1, 3.9.2, 3.9.2, 3.10.0, 3.10.0, 3.11.0, 3.11.0, 3.11.1, 3.11.1, 3.11.2, 3.11.2, 3.11.3, 3.11.3, 3.12.2, 3.12.2, 3.12.4, 3.12.4, 3.13.0, 3.13.0, 3.14.0, 3.14.0, 3.15.0, 3.15.0, 3.15.1, 3.15.1, 3.15.2, 3.15.2, 3.15.3, 3.15.3, 3.15.4, 3.15.4, 3.15.5, 3.15.5, 3.15.6, 3.15.6, 3.15.7, 3.15.7, 3.15.8, 3.15.8, 3.16.0, 3.16.0, 3.17.0, 3.17.0, 3.17.1, 3.17.1, 3.17.2, 3.17.2, 3.17.3, 3.17.3, 3.17.3, 3.18.0, 3.18.0, 3.18.0, 3.18.1, 3.18.1, 3.18.1, 3.19.0, 3.19.0, 3.19.0, 3.19.1, 3.19.1, 3.19.1, 3.19.2, 3.19.2, 3.19.2, 3.19.3, 3.19.3, 3.19.3, 3.19.4, 3.19.4, 3.19.4, 3.20.0, 3.20.0, 3.20.0, 3.20.1, 3.20.1, 3.20.1, 4.21.0, 4.21.0, 4.21.0, 4.21.0, 4.21.1, 4.21.1, 4.21.1, 4.21.1
Skipped pre-versions: 2.0.0b0, 3.0.0a2, 3.0.0a3, 3.0.0b1, 3.0.0b1.post1, 3.0.0b1.post2, 3.0.0b2, 3.0.0b2, 3.0.0b2.post1, 3.0.0b2.post1, 3.0.0b2.post2, 3.0.0b2.post2, 3.0.0b3, 3.0.0b4, 3.0.0b4, 3.2.0rc1, 3.2.0rc1, 3.2.0rc1.post1, 3.2.0rc1.post1, 3.2.0rc2, 3.2.0rc2, 3.7.0rc2, 3.7.0rc2, 3.7.0rc3, 3.7.0rc3, 3.8.0rc1, 3.8.0rc1, 3.9.0rc1, 3.9.0rc1, 3.10.0rc1, 3.10.0rc1, 3.11.0rc1, 3.11.0rc1, 3.11.0rc2, 3.11.0rc2, 3.13.0rc3, 3.13.0rc3, 3.14.0rc1, 3.14.0rc1, 3.14.0rc2, 3.14.0rc2, 3.14.0rc3, 3.14.0rc3, 3.15.0rc1, 3.15.0rc1, 3.15.0rc2, 3.15.0rc2, 3.16.0rc1, 3.16.0rc1, 3.16.0rc2, 3.16.0rc2, 3.17.0rc1, 3.17.0rc1, 3.17.0rc2, 3.17.0rc2, 3.18.0rc1, 3.18.0rc1, 3.18.0rc1, 3.18.0rc2, 3.18.0rc2, 3.18.0rc2, 3.19.0rc1, 3.19.0rc1, 3.19.0rc1, 3.19.0rc2, 3.19.0rc2, 3.19.0rc2, 3.20.0rc1, 3.20.0rc1, 3.20.0rc1, 3.20.0rc2, 3.20.0rc2, 3.20.0rc2, 3.20.1rc1, 3.20.1rc1, 3.20.1rc1, 4.0.0rc1, 4.0.0rc1, 4.0.0rc2, 4.0.0rc2, 4.21.0rc1, 4.21.0rc1, 4.21.0rc1, 4.21.0rc1, 4.21.0rc2, 4.21.0rc2, 4.21.0rc2, 4.21.0rc2
There are incompatible versions in the resolved dependencies:
  protobuf==4.21.1 (from -r requirements.in (line 4))
  protobuf<4.0.0dev,>=3.15.0 (from google-api-core==2.8.1->google_api_python_client==2.49.0->-r requirements.in (line 2)

The requirements.in file it is referencing contains the following:

filelock==3.7.0
google_api_python_client==2.49.0
google_auth_oauthlib==0.5.1
protobuf==4.21.1
scipy==1.8.1
sentry_sdk==1.5.12

I checked pypi and clearly, protobuf==4.21.1 is there.

Why is this problem happening?

Generally, I've had problems with protobuf.

If I am not mistaken, isn't the problem that pipreqs says I need 4.21.1 but the software requires it to be between 4.0.0 and 3.15.0? Obviously, that is an invalid condition.

How can I get pipreqs to require the correction version such as 3.20.1?

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

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

发布评论

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

评论(1

浅唱ヾ落雨殇 2025-02-10 11:54:06

似乎不可能包装版本条件。

条件是:

  • 3.15.0&lt;版本&lt; 4.0.0(来自gmail api
  • 版本== 4.21.1(来自pipreqs?),

我不确定为什么pipreqs正在生成一个要求。在上说protobuf == 4.21.1gmail api需要3.15.0和4.0.0之间的内容时。

我最终手动替换protobuf == 4.21.1unignts.in文件中,然后将pipreqspip-分开。编译命令,以便我可以在传递到pip-compile之前修改InterMediate sublice.in文件,这是发生错误的地方。

os.system("pipreqs ./myProject --savepath requirements.in --force")
lines = None
with open('requirements.in', 'r') as FID: 
    lines = FID.readlines()
    for index,line in enumerate(lines ): 
        if 'protobuf' in line: 
            lines[index] = 'protobuf==3.20.1\n'

with open('requirements.in', 'w') as FID: 
    FID.writelines(lines)
    
os.system("pip-compile")

It appears the package version condition is not possible.

The conditions are:

  • 3.15.0 < Version < 4.0.0 (from Gmail API)
  • Version == 4.21.1 (from pipreqs?)

I'm not certain why pipreqs is generating a requirements.in file that says protobuf==4.21.1 when the Gmail API requires something between 3.15.0 and 4.0.0.

I ended up manually replacing the protobuf==4.21.1 in the requirements.in file, and separated the pipreqs and pip-compile commands so that I could modify the intermediate requirements.in file before being passed into pip-compile, which is where the error was occurring.

os.system("pipreqs ./myProject --savepath requirements.in --force")
lines = None
with open('requirements.in', 'r') as FID: 
    lines = FID.readlines()
    for index,line in enumerate(lines ): 
        if 'protobuf' in line: 
            lines[index] = 'protobuf==3.20.1\n'

with open('requirements.in', 'w') as FID: 
    FID.writelines(lines)
    
os.system("pip-compile")
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文