git模块安装的问题

2024-07-01 08:30:47 发布

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

我已经尝试用pip/pip3和conda安装git。 在使用pip/pip3时,我在shell中得到以下内容:

(base) Micheles-MacBook-Air:~ michelegiglioni$ pip install git
ERROR: Could not find a version that satisfies the requirement git (from versions:none)
ERROR: No matching distribution found for git

(base) Micheles-MacBook-Air:~ michelegiglioni$ pip3 install git
Collecting git
ERROR: Could not find a version that satisfies the requirement git (from versions: none)
ERROR: No matching distribution found for git
WARNING: You are using pip version 19.2.3, however version 20.1.1 is available.

我还将git更新为最新版本,并重新运行pip install命令,但没有成功。 我还尝试过与康达进行以下交流:

conda install -c conda-forge git 

它显然下载了git,但JupiterLab中的结果仍然是:

import git

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-99021728f681> in <module>
----> 1 import git

ModuleNotFoundError: No module named 'git'  

你对我如何继续使用git模块有什么建议吗? 多谢各位


Tags: installpipnogitbaseversionpip3not
1条回答
网友
1楼 · 发布于 2024-07-01 08:30:47

PyPI官方站点中没有允许您执行命令pip install git的git包。这就是你的第一个命令失败的原因。可能您尝试使用了错误的包名

如果this是您要查找的包,请尝试命令pip install gitpython

相关问题 更多 >

    热门问题