使用 pip 安装了错误的依赖项

问题描述 投票:0回答:1

我想知道是否有人可以帮助我解决这个问题:

我有两个 python 库 limespecsy,其中第一个库是第二个库的依赖项。

当我向 PyPi 添加石灰时,有另一个同名的库,所以我声明它是石灰稳定的。

我现在已将specsy上传到其PyPi,但是当我尝试安装它时,会发生这种情况:

a)它安装第三方“lime”库(不是我的)

b) 它安装旧版本的specsy。

我实际上已在三个不同的地方将其声明为“石灰稳定”:

a)我认为是预期位置的project.toml:

[project]
name = "specsy"
version = "0.2.2"
readme = "README.rst"
description = "Model fitting package for the chemical analysis of astronomical spectra"
dependencies = ["arviz~=0.18",
                "astropy~=6.0",
                "corner~=2.2",
                "h5netcdf~=1.3.0",
                "jax~=0.4",
                "jaxlib==0.4.26",
                "lime-stable~=1.0",
                "lmfit~=1.3",
                "matplotlib~=3.8",
                "numpy~=1.26",
                "pandas~=2.2.2",
                "pymc~=5.13",
                "PyNeb~=1.1",
                "pytensor~=2.20",
                "scipy~=1.13",
                "six~=1.16.0",
                "toml~=0.10",
                "tomli >= 2.0.0 ; python_version < '3.11'",
                "xarray~=2024.3.0"]

b)requirements.txt 文件

arviz~=0.18
astropy~=6.0
corner~=2.2
h5netcdf~=1.3.0
jax~=0.4
jaxlib~=0.4
lime-stable~=1.0
lmfit~=1.3
matplotlib~=3.8
numpy~=1.26
pandas~=2.2.2
pymc~=5.13
PyNeb~=1.1
pytensor~=2.20
scipy~=1.13
six~=1.16.0
toml~=0.10
tomli >= 2.0.0 ; python_version < "3.11"
xarray~=2024.3.0

c) 和 setup.py 文件:

  packages=find_packages('src'),
  package_dir={'': 'src'},
  package_data={'': ['config.toml', 'inference/*', 'innate/*', 'models/*', 'operations/*', 'resources/*', 'workflow/*']},
  include_package_data=True,
  install_requires=["arviz", "astropy", "h5netcdf", "jax", "jaxlib", "lime-stable", "lmfit", "matplotlib", "numpy",
                    "pandas", "pymc", "PyNeb", "pytensor", "scipy", "toml", "xarray"],

但它仍然从 pip 安装“lime”而不是“lime-stable”。

我想知道是否有人可以指出我冲突的根源。

python pip dependencies dependency-properties requirements.txt
1个回答
0
投票

所以我尝试 pip install

specsy
。它拉出了正确的版本 0.2.2,如
pip freeze > requirements.txt
输出

所示
lime-stable==1.0.0
lmfit==1.3.1
logical-unification==0.4.6
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.8.4
.
.
.
specsy==0.2.2
Sphinx==7.3.7
sphinxcontrib-applehelp==1.0.8
sphinxcontrib-devhelp==1.0.6
sphinxcontrib-htmlhelp==2.0.5
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.7
sphinxcontrib-serializinghtml==1.1.10
stack-data==0.6.3
tinycss2==1.3.0
toml==0.10.2

所以我无法重现您所说的错误。这些版本也是您在 PyPi 包中拥有的版本。

© www.soinside.com 2019 - 2024. All rights reserved.