venv 中的 pip 不考虑已安装的包

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

我已经创建了一个 Python 包,我想在我的 venv 中使用 pip 安装它。 它有几个依赖项。这些并不都在 pypi 上,但它们也存在于本地。

如果我这样做

python -m venv /.../venv/
source /.../venv/bin/activate
pip list

我知道

Package             Version Editable project location
------------------- ------- --------------------------------------------
dune-alugrid        2.9.0   /dune/dune-alugrid/build-cmake/python
dune-common         2.9.0   /dune/dune-common/build-cmake/python
dune-foamgrid       2.10.0  /dune/dune-foamgrid/build-cmake/python
dune-functions      2.9.0   /dune/dune-functions/build-cmake/python
dune-geometry       2.9.0   /dune/dune-geometry/build-cmake/python
dune-grid           2.9.0   /dune/dune-grid/build-cmake/python
dune-istl           2.9.0   /dune/dune-istl/build-cmake/python
dune-localfunctions 2.9.0   /dune/dune-localfunctions/build-cmake/python
dune-vtk            2.9.0   /dune/dune-vtk/build-cmake/python
Jinja2              3.1.2
MarkupSafe          2.1.2
mpi4py              3.1.4
ninja               1.11.1
numpy               1.24.2
pip                 23.0.1
portalocker         2.7.0
scipy               1.10.1
setuptools          67.4.0
wheel               0.38.4

现在我想安装我的包

pip install pyikarus --verbose
python -m pip install pyikarus --verbose
(输出相同)。

pip
无法识别带有
dune-*
的已安装软件包。 因此,pip 开始下载 pypi 上存在的那些。 因此,它以

这样的行开头
  Collecting dune-common<=2.9.0
    Downloading dune-common-2.9.0.tar.gz (823 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 824.0/824.0 kB 7.6 MB/s eta 0:00:00
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'done'
  Collecting dune-grid<=2.9.0
    Downloading dune-grid-2.9.0.tar.gz (3.0 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.0/3.0 MB 5.4 MB/s eta 0:00:00
    Installing build dependencies: started

但是它失败了

 ERROR: Could not find a version that satisfies the requirement dune-functions<=2.9.0 (from versions: none)
 ERROR: No matching distribution found for dune-functions<=2.9.0

因为

dune-functions
在pypi不存在。

问题 我的安装过程有什么问题,为什么 pip 不为我的模块考虑这些已安装的包? 或者有人可以给我提示如何自己调试吗?

为了我的

setup.py
文件的完整性,我已经按照部门所写

requires = ['setuptools',    'wheel',    'scikit-build',    'cmake',    'ninja',    'requests', 'dune-common<=2.9.0', 'dune-grid<=2.9.0', 'dune-geometry<=2.9.0', 'dune-localfunctions<=2.9.0', 'dune-functions<=2.9.0', 'dune-istl<=2.9.0']
pip pypi python-venv python-packaging
© www.soinside.com 2019 - 2024. All rights reserved.