如何将git与pipenv一起使用?
在我的主系统上,我已经安装了git dpkg如何将git与pipenv一起使用?,git,pipenv,Git,Pipenv,在我的主系统上,我已经安装了git dpkg $ dpkg -l | grep git ii git 1:2.25.1-1~ppa0~ubuntu18.04.1 amd64 fast, scalable, distributed revision control system ii git-man
$ dpkg -l | grep git
ii git 1:2.25.1-1~ppa0~ubuntu18.04.1 amd64 fast, scalable, distributed revision control system
ii git-man 1:2.25.1-1~ppa0~ubuntu18.04.1 all fast, scalable, distributed revision control system (manual pages)
在pipenv外壳内时,我是否仍然执行pipenv安装git
以使用git?我确实尝试将git安装在具有pipenv shell的目录中。虽然它写的很成功,但是还有其他警告和错误
$ pipenv install git
Installing git…
Adding git to Pipfile's [packages]…
✔ Installation Succeeded
Pipfile.lock (427769) out of date, updating to (affaee)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✘ Locking Failed!
[pipenv.exceptions.ResolutionFailure]: File "~/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 69, in resolve
[pipenv.exceptions.ResolutionFailure]: req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]: File "~/.local/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]: req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]: File "~/.local/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]: File "~/.local/lib/python3.6/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches git
[pipenv.exceptions.ResolutionFailure]: No versions found
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches git
No versions found
Was https://pypi.org/simple reachable?
[pipenv.exceptions.ResolutionFailure]: req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]: File "~/.local/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]: req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]: File "~/.local/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]: File "~/.local/lib/python3.6/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches git
[pipenv.exceptions.ResolutionFailure]: No versions found
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches git
No versions found
Was https://pypi.org/simple reachable?
无需在
pipenv
中安装git
。您只需将git repo放在目录中即可。该目录将包含您的pipenv
在
pipenv
shell外部运行git
。shell用于管理您的环境,但git控制维护源代码的目录 dpkg
列出了系统包;你有一个系统git
,很好pipenv
(与任何Python包管理器一样-pip
或任何其他)只安装Python包pipenv安装git
installs…嗯,我认为它是一个git
的Python包装,在幕后运行git
。@phd,我认为问题在于如何获取pipenv
提供的任何包的源代码(最好是git存储库的形式)。否则,是的,GitPython是人们通常会得到的东西。@0andriy我不这么认为。“我还需要安装pipenv git来使用git吗?”我想这意味着在git
和GitPython之间存在混淆。@phd@0andrly当我使用pipenv shell
时,我不清楚如何使用git
。在pipenv shell中使用git时,是否需要再次安装git
?或者我需要退出pipenv shell
来提交git
命令吗?我对pipenv
一无所知。pipenv-shell
是否提供OS-shell或Python命令行?@Sun-Bear这不应该是批准的答案吗?显然,在pipenv
中安装git
不是一个好办法。我想指出,您可以在pipenv
shell中运行git
命令。因此,这不一定是一种可怕的方法。