I would like to ask how to solve this problem












-4















Traceback (most recent call last):
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 83, in <module>
refresh()
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 73, in refresh
if not Git.refresh(path=path):
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/cmd.py", line 290, in refresh
raise ImportError(err)
ImportError: 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


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "github-scraper/scraper.py", line 5, in <module>
from PyRepo import PyRepo
File "/home/shi/PycharmProjects/pycodesuggest-master/github-scraper/PyRepo.py", line 2, in <module>
from git import Repo
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 85, in <module>
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 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









share|improve this question




















  • 1





    You’re question is very hard to read. Please edit your question, read How to Ask, and include a Minimal, Complete, and Verifiable example.

    – evolutionxbox
    Nov 26 '18 at 6:31


















-4















Traceback (most recent call last):
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 83, in <module>
refresh()
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 73, in refresh
if not Git.refresh(path=path):
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/cmd.py", line 290, in refresh
raise ImportError(err)
ImportError: 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


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "github-scraper/scraper.py", line 5, in <module>
from PyRepo import PyRepo
File "/home/shi/PycharmProjects/pycodesuggest-master/github-scraper/PyRepo.py", line 2, in <module>
from git import Repo
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 85, in <module>
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 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









share|improve this question




















  • 1





    You’re question is very hard to read. Please edit your question, read How to Ask, and include a Minimal, Complete, and Verifiable example.

    – evolutionxbox
    Nov 26 '18 at 6:31
















-4












-4








-4








Traceback (most recent call last):
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 83, in <module>
refresh()
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 73, in refresh
if not Git.refresh(path=path):
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/cmd.py", line 290, in refresh
raise ImportError(err)
ImportError: 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


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "github-scraper/scraper.py", line 5, in <module>
from PyRepo import PyRepo
File "/home/shi/PycharmProjects/pycodesuggest-master/github-scraper/PyRepo.py", line 2, in <module>
from git import Repo
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 85, in <module>
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 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









share|improve this question
















Traceback (most recent call last):
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 83, in <module>
refresh()
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 73, in refresh
if not Git.refresh(path=path):
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/cmd.py", line 290, in refresh
raise ImportError(err)
ImportError: 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


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "github-scraper/scraper.py", line 5, in <module>
from PyRepo import PyRepo
File "/home/shi/PycharmProjects/pycodesuggest-master/github-scraper/PyRepo.py", line 2, in <module>
from git import Repo
File "/home/shi/anaconda3/lib/python3.6/site-packages/git/__init__.py", line 85, in <module>
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 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






python git gitpython






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 26 '18 at 12:18









phd

23.9k52646




23.9k52646










asked Nov 26 '18 at 4:50









SMYshimingyuSMYshimingyu

1




1








  • 1





    You’re question is very hard to read. Please edit your question, read How to Ask, and include a Minimal, Complete, and Verifiable example.

    – evolutionxbox
    Nov 26 '18 at 6:31
















  • 1





    You’re question is very hard to read. Please edit your question, read How to Ask, and include a Minimal, Complete, and Verifiable example.

    – evolutionxbox
    Nov 26 '18 at 6:31










1




1





You’re question is very hard to read. Please edit your question, read How to Ask, and include a Minimal, Complete, and Verifiable example.

– evolutionxbox
Nov 26 '18 at 6:31







You’re question is very hard to read. Please edit your question, read How to Ask, and include a Minimal, Complete, and Verifiable example.

– evolutionxbox
Nov 26 '18 at 6:31














1 Answer
1






active

oldest

votes


















0














I think the message is very explicit about what's going on: git is not in the PATH. The python script that is complaining is probably making a call to run "git". In order for this to work, git executable's directory must be included as a directory in PATH. If it's not, then the call is going to fail miserably. The other possibility is by setting another environment variable (GIT_PYTHON_EXECUTABLE) where you can specify the location of the git executable itself if it's not in PATH and you don't want to mess with the PATH variable.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53474936%2fi-would-like-to-ask-how-to-solve-this-problem%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I think the message is very explicit about what's going on: git is not in the PATH. The python script that is complaining is probably making a call to run "git". In order for this to work, git executable's directory must be included as a directory in PATH. If it's not, then the call is going to fail miserably. The other possibility is by setting another environment variable (GIT_PYTHON_EXECUTABLE) where you can specify the location of the git executable itself if it's not in PATH and you don't want to mess with the PATH variable.






    share|improve this answer




























      0














      I think the message is very explicit about what's going on: git is not in the PATH. The python script that is complaining is probably making a call to run "git". In order for this to work, git executable's directory must be included as a directory in PATH. If it's not, then the call is going to fail miserably. The other possibility is by setting another environment variable (GIT_PYTHON_EXECUTABLE) where you can specify the location of the git executable itself if it's not in PATH and you don't want to mess with the PATH variable.






      share|improve this answer


























        0












        0








        0







        I think the message is very explicit about what's going on: git is not in the PATH. The python script that is complaining is probably making a call to run "git". In order for this to work, git executable's directory must be included as a directory in PATH. If it's not, then the call is going to fail miserably. The other possibility is by setting another environment variable (GIT_PYTHON_EXECUTABLE) where you can specify the location of the git executable itself if it's not in PATH and you don't want to mess with the PATH variable.






        share|improve this answer













        I think the message is very explicit about what's going on: git is not in the PATH. The python script that is complaining is probably making a call to run "git". In order for this to work, git executable's directory must be included as a directory in PATH. If it's not, then the call is going to fail miserably. The other possibility is by setting another environment variable (GIT_PYTHON_EXECUTABLE) where you can specify the location of the git executable itself if it's not in PATH and you don't want to mess with the PATH variable.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 26 '18 at 6:02









        eftshift0eftshift0

        5,6421021




        5,6421021
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53474936%2fi-would-like-to-ask-how-to-solve-this-problem%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Wiesbaden

            Marschland

            Dieringhausen