“ImportError: No module named git”报错解决办法

写爬虫的时候,从github上git下来代码,发现人家有一行

from git import Repo

于是就产生报错

ImportError: No module named git”

没有这个包,那下载一下不就好了,由于我用的是conda,接下来展示的都是conda方法,没有conda的先下载一个吧……

搜索进入https://anaconda.org/conda-forge/git

在命令行输入以下任一行(输一行就够了!):

conda install -c conda-forge git 
conda install -c conda-forge/label/gcc7 git 
conda install -c conda-forge/label/broken git 
conda install -c conda-forge/label/cf201901 git 

发现还是不行,依然报错,再次搜索,发现是gitpython这个包没有下载,再次下载

进入https://anaconda.org/conda-forge/gitpython

依然是任选一行输入:

conda install -c conda-forge gitpython 
conda install -c conda-forge/label/gcc7 gitpython 
conda install -c conda-forge/label/cf201901 gitpython 

下载之后,再运行.py文件,成功!

(下载gitpython之前我以为是我conda错了,卸了重装一遍,现在还在装pytorch,都是泪啊TAT)

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值