pipenv正在尝试从github安装本地包

2024-04-24 21:29:46 发布

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

我正在尝试使用pipenv安装多个包;有些是pypi的正常方式,有些是github的,还有一些是本地的。在

但是,它似乎总是尝试从github安装本地包!在

下面是一些代码:

Pipfile:

[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = "==2.2"
djangorestframework = "*"

[packages.my-remote-package]
git = "https://github.com/my_organization/my-remote-package.git"
editable = true
ref = "master"

[packages.ed0a5ba]
path = "./.."
editable = true

[requires]
python_version = "3.7"

(由“ed0a5ba”指定的依赖项包括一个setup.py,该文件包my-local-package。)

当我运行pipenv update时,我得到以下类型的输出:

Installing dependencies from Pipfile.lock (30bcaa)…

An error occurred while installing -e git+https://github.com/my_organization/my-local-package.git@aa8362b12ad95cd1f338110dc179a98c530e2906#egg=my-local-package! Will try again.

...

现在,“我的组织”确实在github上有一个“我的本地包”存储库(它现在正好有错误)。但为什么pipenv还要看那里呢?我在Pipfile中只将“my remote package”指定为git依赖项。在


更多信息…

在运行pipenv install -e ..之后Pipfile.lock文件“文件包括以下行:

^{pr2}$

在运行pipenv install -e git+https://github.com/my_organization/my-remote-package.git@master#egg=my-remote-package之后Pipfile.lock文件“文件包括以下行:

"my-remote-package": {
  "editable": true,
  "git": "https://github.com/my_organization/my-remote-package.git",
  "ref": "c65ca035d526adc0eda9d229b0cff01d2c30c35b"
},
"my-local-package": {
   "editable": true,
   "git": "https://github.com/my_organization/my-local-package.git",
   "ref": "aa8362b12ad95cd1f338110dc179a98c530e2906"
},

但我从没告诉过pipenv尝试从git安装除了“我的远程包”之外的任何东西?!?


Tags: 文件httpsgitgithubpypicomtruepackage