写爬虫的时候,从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)