<p>我正在尝试在我的<strong>Windows</strong>计算机上安装Google Cloud SDK。我已经在这台机器上安装了Python2.7,它位于系统变量路径中,就像这样->;<code>C:\Python27\;</code></p>
<p>我在安装过程中遇到此错误:</p>
<blockquote>
<p>ERROR: gcloud failed to load: DLL load failed: %1 is not a valid Win32
application.</p>
</blockquote>
<p>错误消息还提示我检查Python可执行文件,方法是:</p>
<blockquote>
<p>If it is not, please set the CLOUDSDK_PYTHON environment variable to
point to a working Python 2.7 executable.</p>
</blockquote>
<p>所以,我试图在install.sh shell脚本中设置CLOUDSDK_PYTHON环境变量……但是没有任何工作。以下是该文件中的代码:</p>
<pre><code>echo Welcome to the Google Cloud SDK!
if [ -z "$CLOUDSDK_PYTHON" ]; then
if [ -z "$(which python)" ]; then
echo
echo "To use the Google Cloud SDK, you must have Python installed and on your PATH."
echo "As an alternative, you may also set the CLOUDSDK_PYTHON environment variable"
echo "to the location of your Python executable."
exit 1
fi
CLOUDSDK_PYTHON="python"
fi
</code></pre>
<p><strong>我尝试过</strong><code>python2.7</code>,以及可执行文件的路径<code>C:\Python27</code>,但是当我尝试使用这些变量运行脚本时,出现了以下错误:</p>
<pre><code>install.sh: line 128: $'python\r': command not found
</code></pre>
<p>我找到了这个<a href="https://stackoverflow.com/questions/30832990/google-cloud-sdk-set-environment-variable-python-linux">stack question</a>,但是没有一个解决方案对我有效。任何帮助都将不胜感激。</p>