如何在windows中用gitbash设置python路径?

How to set python path with git bash in windows?

在 Windows 10 上使用 Git Bash。

python版本:2.7.12

当运行pip时,显示:

$ pip
bash: /c/cygwin/bin/pip: /usr/bin/python2.7: bad interpreter: No such file or directory

如何使用 pip 找到正确的 python 路径?


加法

$ which python
/c/cygwin/bin/python

您的 pip 以某种方式为您的 python 使用了不存在的错误路径。但是,有一个简单的解决方法,您可以键入它来指定您要使用的 python 解释器:

$ /c/cygwin/bin/python -m pip install yourpackage 

这只是一个临时解决方法,要修复它,请尝试 问题中的内容。