/bin/env:python:没有这样的文件或目录(Windows通过Git Bash尝试安装新的Parse Cloud Code) [英] /bin/env: python: No such file or directory (Windows through Git Bash trying to install new Parse Cloud Code)

查看:195
本文介绍了/bin/env:python:没有这样的文件或目录(Windows通过Git Bash尝试安装新的Parse Cloud Code)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试从此处的链接安装python似乎无法访问python Msysgit中的命令...按照此处的说明 ,实际上并未说明如何使python根据需要工作.

Trying to install python from the link here does not seem to give access to the python command in Msysgit... following the instructions here, does not actually say how to get python to work as needed.

运行parse new project_name时的当前错误是:

/bin/env:python:没有这样的文件或目录

/bin/env: python: No such file or directory

我相信这很可能是因为它安装在C:\Python上……有人知道如何解决此问题?

I believe it's likely because it installed it at C:\Python... anyone know how to fix this?

推荐答案

此错误表示Git Bash不知道您的python.exe在哪里.它会搜索您普通的Windows搜索路径,即PATH环境变量.您可能无法按照已经说明确保Python在Git Bash中正常工作"的第4步操作:

This error means that Git Bash does not know where your python.exe is. It searches your normal windows search path, the PATH environment variable. You're probably failing the 4th step on the instructions already "Make sure Python is working in the Git Bash":

$ python --version
sh.exe: python: command not found

要解决此问题,请在Windows (<此处的说明).您需要在此之后重新启动bash,以使更改生效.这也将允许您从Windows命令提示符处运行python.

To fix that, append C:\Python (or wherever you installed python) to your PATH environment variable in windows (instructions here). You need to restart the bash after this for the change to take effect. This will allow you to run python from the windows command prompt as well.

C:\> python --version
Python 2.7.2


如果您不想更改Windows PATH变量或只让python bash可以使用python,则可以在%USERPROFILE%目录中创建一个.bashrc文件,然后在此处设置变量:


If you don't want to alter your windows PATH variable or make python only available to git bash, you could create a .bashrc file in your %USERPROFILE% directory and set the variable there:

C:\>notepad %USERPROFILE%\.bashrc

并添加

export PATH =/c/Python:$ PATH

export PATH=/c/Python:$PATH

到文件.每次启动git bash并在git bash的PATH变量前加上C:\Python时,都会执行该脚本,而不会改变系统范围内的PATH变量.

to the file. That script is executed every time you start the git bash and prepends C:\Python to git bash's PATH variable, leaving the system-wide PATH variable untouched.

现在您知道必须执行的操作,可以在bash上使用此快捷方式(将export命令附加到.bashrc上)

Now that you know what has to be done, you can use this shortcut on the bash instead (appends the export command to your .bashrc)

$ echo export PATH=/c/Python:\$PATH >> ~/.bashrc

这篇关于/bin/env:python:没有这样的文件或目录(Windows通过Git Bash尝试安装新的Parse Cloud Code)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆