【发布时间】:2019-05-29 17:16:29
【问题描述】:
我在我的项目中使用 Python 3.7。然后当我尝试做
edamame$ git commit --amend --no-edit
我收到以下错误(git status 工作正常):
Your PYTHONPATH points to a site-packages dir for Python 3.x but you are running Python 2.x!
PYTHONPATH is currently: "/Users/edamame/tools/sim/scripting/:/usr/local/lib/python3.7/:/usr/local/lib/python3.7/site-packages/"
You should `unset PYTHONPATH` to fix this.
我尝试了以下但没有运气:
edamame$ pip3 install git
Collecting git
Could not find a version that satisfies the requirement git (from versions: )
No matching distribution found for git
所以我每次都必须像下面这样手动设置 PYTHONPATH,这非常不方便。有什么建议吗?谢谢!
edamame$ export PYTHONPATH=
【问题讨论】:
-
git commit通常不会调用 Python。.git/hooks中是否启用了任何钩子,如果有,是否使用 Python? -
我在.git/hooks下有以下内容:commit-msg.sample post-merge pre-commit.sample pre-receive.sample .. fsmonitor-watchman.sample post-update.sample pre -push prepare-commit-msg.sample applypatch-msg.sample post-checkout pre-applypatch.sample pre-push.sample update.sample commit-msg post-commit pre-commit pre-rebase.sample 但我不确定是否他们使用 Python ...
标签: python-3.x git python-2.7 pre-commit-hook