在 Google Cloud Shell 上设置环境以使用 Cloud ML 时出错

Error setting up environment on Google Cloud Shell to use Cloud ML

遵循 https://cloud.google.com/ml/docs/how-tos/getting-set-up 的说明:

  1. 创建了一个项目并启动了 Cloud Shell。
  2. 运行 下面的脚本用于安装所需的工具和依赖项

    卷曲 https://raw.githubusercontent.com/GoogleCloudPlatform/cloudml-samples/master/tools/setup_cloud_shell.sh | bash

预期结果 >>

"Success! Your environment has the required tools and dependencies." when the script finishes successfully.

实际结果>>

+ pip install --user --upgrade 'pillow>=3.4.2' --global-option=build_ext --global-option=--disable-jpeg
/usr/local/lib/python2.7/dist-packages/pip-8.1.1-   py2.7.egg/pip/commands/install.py:180: UserWarning: Disabling all use of wheels    due to the use of --build-options / --g
lobal-options / --install-options.
cmdoptions.check_install_build_global(options)
Collecting pillow>=3.4.2
Using cached Pillow-4.0.0.tar.gz
Collecting olefile (from pillow>=3.4.2)
Using cached olefile-0.43.zip
Installing collected packages: olefile, pillow
Running setup.py install for olefile ... error
Complete output from command /usr/bin/python -u -c "import setuptools,     tokenize;__file__='/tmp/pip-build-  KwQqVS/olefile/setup.py';exec(compile(getattr(tokenize, 'op
en', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --disable-jpeg install --record /tmp/pip-eOHYKZ-record/install-record.txt --single-vers
ion-externally-managed --compile --user --prefix=:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: -c --help [cmd1 cmd2 ...]
   or: -c --help-commands
   or: -c cmd --help

error: option --disable-jpeg not recognized

----------------------------------------
Command "/usr/bin/python -u -c "import setuptools,    tokenize;__file__='/tmp/pip-build-   KwQqVS/olefile/setup.py';exec(compile(getattr(tokenize, 'open', open)   (__file__).rea
d().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --disable-jpeg   install --record /tmp/pip-eOHYKZ-record/install-record.txt --single-version-  externally-managed -
-compile --user --prefix=" failed with error code 1 in /tmp/pip-build-  KwQqVS/olefile/

我遇到了同样的问题,我已经解决了。 错误来自 Pilow。 首先,您应该单独安装 Pillow:(使用 sudo)

sudo pip install --upgrade pillow

然后你再次运行命令:

curl https://raw.githubusercontent.com/GoogleCloudPlatform/cloudml-samples/master/tools/setup_cloud_shell.sh | bash

一切都会好起来的。

修复已推送至 Github,新版本已推送

pip install --user --upgrade pillow,

没有“--disable-jpeg”选项。看来新版Pillow解决了中提到的问题,去掉了选项