Python库相互依赖性解决问题

2024-06-25 23:37:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我的setup.py中有mymainapp的以下部分:

 install_requires=[
          'myapp1==0.2.0',
          'myapp2==0.6.0',
...
]

以下是这两个应用程序/依赖项对应的install_requires部分:

myapp1 0.2.0

install_requires=[
  sas==1.2.0'
],

myapp2 0.6.0

install_requires=[
   sas==1.6.1'
],

然后我在表演

pip wheel --find-links="wheelhouse/" --wheel-dir="wheelhouse/" .

(当然使用mymainappsetup.py

当尝试使用创建的wheelhouse安装应用程序时

pip install --find-links=wheelhouse --no-index mymainapp

它失败,出现以下错误:

Collecting sas==1.6.1 (from `myapp2`==0.6.0->mymainapp)
  Could not find a version that satisfies the requirement sas==1.6.1 (from myapp2==0.6.0->mymainapp) (from versions: 1.2.0)

考虑到它成功地安装了两个myapp1myapp2作为mymainapp的依赖项,-即创建了两个.whl文件-为什么它找不到其中一个依赖项

TL;DRmymainappmyapp1myapp2有依赖性,这反过来又依赖于同一应用程序的不同版本(sas))


Tags: installpipfrompy应用程序setuplinksfind