I would like to ask how to solve this problem
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
add a comment |
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
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
add a comment |
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
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
python git gitpython
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 26 '18 at 6:02
eftshift0eftshift0
5,6421021
5,6421021
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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