“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)
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐



所有评论(0)