Python库相互依赖解决问题

2024-06-25 23:50:01 发布

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

我在setup.pymymainapp中有以下部分:

 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/" .

(当然使用setup.pymymainapp

当尝试使用创建的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上有Depdencies,而这两个Depdencies又依赖于同一应用程序的不同版本(sas))


Tags: installpipfrompy应用程序setuplinksfind