潇洒郎:gitpython 学习-解决Bad git executable, export GIT_PYTHON_REFRESH=quiet问题

这篇具有很好参考价值的文章主要介绍了潇洒郎:gitpython 学习-解决Bad git executable, export GIT_PYTHON_REFRESH=quiet问题。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

错误如下:

ImportError: Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
    - quiet|q|silence|s|none|n|0: for no warning or exception
    - warn|w|warning|1: for a printed warning
    - error|e|raise|r|2: for a raised exception

Example:
    export GIT_PYTHON_REFRESH=quiet

错误原因: 无法找到git.exe

解决办法:寻找git.exe, 然后给git.exe 添加环境变量,重启电脑

寻找git——打开git-bash , 输入where git  文章来源地址https://www.toymoban.com/news/detail-609356.html

到了这里,关于潇洒郎:gitpython 学习-解决Bad git executable, export GIT_PYTHON_REFRESH=quiet问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • yolov8运行出错及解决,No module named ‘ultralytics‘和ImportError: Failed to initialize: Bad git executable

    成功解决 No module named \\\'ultralytics’和Failed to initialize: Bad git executable的问题,以此记录和分享。 问题: 解决: 在文件开头开间绝对路径,即ultralytics文件夹所在的文件夹路径。 问题: 解决: 在utils文件夹中的__init__.py的138行位置,即 import git 上方添加下面代码,即可解决。

    2024年02月03日
    浏览(31)
  • Import Error: Bad git executable.

    本文针对不需要使用git,如果使用到了git的朋友就可以不用看啦。 在学习过程中碰到了这个问题,ImportError:bad git executable,但其实我并没有用到git。当然有可能是包版本的问题。 如果不需要使用git的话,可以在报错的几个文件中添加 os.environ[\\\"GIT_PYTHON_REFRESH\\\"] = \\\"quiet\\\" 添加位置

    2024年04月24日
    浏览(32)
  • python调用git出错:ImportError: Failed to initialize: Bad git executable.

    #报错信息 Traceback (most recent call last): File “”, line 1, in File “C:Python27libsite-packagesgit_ init _.py”, line 85, in raise ImportError(‘Failed to initialize: {0}’.format(exc)) ImportError: Failed to initialize: Bad git executable. The git executable must be specified in one of the following ways: - be included in your $PATH - be

    2024年02月08日
    浏览(28)
  • YOLOv5运行错误:ImportError: Failed to initialize: Bad git executable.

    问题描述:我们在跑YOLOv5官方数据集时,出现这个错误,ImportError: Failed to initialize: Bad git executable. 具体错误如下 具体原因:未知 解决办法: 在train.py文件中的import os后面加上 具体位置

    2024年02月11日
    浏览(58)
  • zsh: bad CPU type in executable: /usr/local/bin/git

    查找原因: 通过 where git 可以看到有2个路径 一个/usr/bin/git一个/usr/bin/local/git which git 返回/usr/bin/local/git 而 /usr/bin/local/git --version也报这个错 zsh: bad CPU type in executable 应该是由于mac自带git,而我又安装了一个git,导致产生冲突 解决方式就是卸载掉自己安装的git sh /usr/local/git/

    2024年02月11日
    浏览(48)
  • 【解决】ERROR: Cannot execute /export/server/hadoop-3.3.0/libexec/yarn-config.sh 和Attempting to operate

    今天在启动Hadoop集群的时候,我突然发现在Hadoop003虚拟机上的yarn启动不了了。就是在 /opt/module/hadoop-3.1.3/sbin目录下的 start-yarn.sh命令启动不了。总是显示如下错误 ERROR: Cannot execute /export/server/hadoop-3.3.0/libexec/yarn-config.sh  我试了网上的各种办法,也试了删除data 和 logs 重新格式

    2024年04月28日
    浏览(31)
  • 潇洒郎: git配置、拉取、提交代码

    git config --global user.name \\\"xuxiaosa\\\" git config --global user.email \\\"xuxiaosa@migu.cn\\\" 1、打开git-bash 输入ssh-keygen 一直回车,会提示文件保存的地址 id_rsa,id_rsa.pub两个文件默认在user/.ssh目录下     不用https git pull git add . git commit -m \\\'优化用户建立连接后等待问题,避免超时断链\\\' git push git che

    2023年04月23日
    浏览(39)
  • mac m1: bad cpu type in executable

    最近淘了一台mac电脑,但是要使用grpc的protoc的时候却显示了如下的提示: 本来以为是因为protoc不是为aarch 64构建的因此无法运行,因为文件目录确实是在x86_64文件夹下。于是就去下载aarch的protoc,结果还是一样的问题。 由于当macOS尝试运行不是Apple silicon构建的应用程序时,就

    2024年01月17日
    浏览(41)
  • git fatal: bad object refs/heads 解决方案

    (一)问题表现 (二) 解决方案 1、把 .gitrefsremotesorigin 下出问题的分支名称删除掉 2、把.gitrefsheads下出问题的分支名称删除掉 再次执行git pull --rebase即可解决。 (三)参考文档: git提交的时候出现异常“bad object HEAD”的另一种解决方案_buzaiyouyu001的博客-CSDN博客

    2024年02月16日
    浏览(42)
  • Cause: error=86, Bad CPU type in executable

    Mac Android Studio 运行项目 报错 Cause: error=86, Bad CPU type in executable 原因 ADB 不支持 ARM。应该是苹果系统更新了某些东西 导致不支持 解决方案 终端输入 softwareupdate --install-rosetta 出现 I have read and agree to the terms of the software license agreement. A list of Apple SLAs may be found here: http://www.app

    2024年02月04日
    浏览(41)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包