BigQueryをcliで使うのに対象のサーバにGoogle Cloud SDKをインストールしたら以下のようにエラー出た。あまりにもハマったのでブログします。
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$ ./install.sh Welcome to the Google Cloud SDK! Traceback (most recent call last): File "/home/adachin/google-cloud-sdk/bin/bootstrapping/install.py", line 12, in <module> import bootstrapping File "/home/adachin/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 32, in <module> import setup # pylint:disable=g-import-not-at-top File "/home/adachin/google-cloud-sdk/bin/bootstrapping/setup.py", line 55, in <module> from googlecloudsdk.core import properties File "/home/adachin/google-cloud-sdk/lib/googlecloudsdk/core/properties.py", line 368 self.__sections = {section.name: section for section in sections} ^ SyntaxError: invalid syntax |
■Can’t install gcloud on Amazon Linux : invalid syntax
https://stackoverflow.com/questions/50992705/cant-install-gcloud-on-amazon-linux-invalid-syntax
On top of python 2.7 installed on the “python” command, I also had python 2.6 installed on the “python2” command. Uninstalling python 2.6 solved the issue, Google Cloud install went through without issue on the next try.
(訳)
python 2.7に加えて、 python2コマンドにもpython 2.6がインストールされてるぜ。python 2.6をアンインストールすると、SDKのインストールできるよ。
- 確認
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# yum remove python2 Loaded plugins: fastestmirror, priorities, update-motd, upgrade-helper Resolving Dependencies --> Running transaction check ---> Package python26.x86_64 0:2.6.9-2.89.amzn1 will be erased --> Processing Dependency: python(abi) = 2.6 for package: python-meld3-0.6.7-1.el6.x86_64 --> Processing Dependency: python(abi) = 2.6 for package: python-meld3-0.6.7-1.el6.x86_64 --> Processing Dependency: python26 = 2.6.9-2.89.amzn1 for package: python26-libs-2.6.9-2.89.amzn1.x86_64 --> Running transaction check ---> Package python-meld3.x86_64 0:0.6.7-1.el6 will be erased ---> Package python26-libs.x86_64 0:2.6.9-2.89.amzn1 will be erased --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================================================== Package Arch Version Repository Size ====================================================================================================================================== Removing: python26 x86_64 2.6.9-2.89.amzn1 @amzn-main 19 M Removing for dependencies: python-meld3 x86_64 0.6.7-1.el6 @epel 293 k python26-libs x86_64 2.6.9-2.89.amzn1 @amzn-main 1.7 M Transaction Summary ====================================================================================================================================== Remove 1 Package (+2 Dependent packages) |
入ってた….のでremoveしちゃう。
SDKインストールすると!!!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$ bq ls datasetId ------------------------ xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx |
✌️
■まとめ
Python2.6が入っていると思わなかった。。。
0件のコメント