首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Ubuntu 14.04LTS for python3上安装google-cloud-sdk

无法在Ubuntu 14.04LTS for python3上安装google-cloud-sdk
EN

Stack Overflow用户
提问于 2021-09-10 20:04:53
回答 1查看 240关注 0票数 0

我无法安装"google-cloud-sdk“并看到此错误

我听从了https://cloud.google.com/sdk/docs/install#deb的指示

代码语言:javascript
复制
    ubuntu@ubuntu:~$ cat /etc/issue                                             
    Ubuntu 14.04.5 LTS                                                          
                                                                                
    ubuntu@ubuntu:~$ sudo apt-get install google-cloud-sdk                      
    Reading package lists... Done                                               
    Building dependency tree                                                    
    Reading state information... Done                                           
    google-cloud-sdk is already the newest version.                             
    0 upgraded, 0 newly installed, 0 to remove and 172 not upgraded.            
    1 not fully installed or removed.                                           
    After this operation, 0 B of additional disk space will be used.            
    Do you want to continue? [Y/n] Y                                            
    Setting up google-cloud-sdk (356.0.0-0) ...                                 
    ERROR: gcloud failed to load: No module named 'typing'                      
        gcloud_main = _import_gcloud_main()                                     
        import googlecloudsdk.gcloud_main                                       
        from googlecloudsdk.calliope import base                                
        from googlecloudsdk.calliope import display                             
        from googlecloudsdk.calliope import display_taps                        
        from googlecloudsdk.core.resource import resource_printer_base          
        from googlecloudsdk.core.resource import resource_projector             
        import proto  # pylint: disable=g-import-not-at-top                     
        from .enums import Enum                                                 
        from proto.marshal.rules.enums import EnumRule                          
        from typing import Type                                                 
                                                                                
    This usually indicates corruption in your gcloud installation or problems with your Python interpreter.
                                                                                
    Please verify that the following is the path to a working Python 2.7 or 3.5+ executable:
        /usr/bin/python3                                                        
                                                                                
    If it is not, please set the CLOUDSDK_PYTHON environment variable to point to a working Python 2.7 or 3.5+ executable.
                                                                                
    If you are still experiencing problems, please reinstall the Cloud SDK using the instructions here:
        https://cloud.google.com/sdk/                                           
    dpkg: error processing package google-cloud-sdk (--configure):              
     subprocess installed post-installation script returned error exit status 1 
    Errors were encountered while processing:                                   
     google-cloud-sdk                                                           
    E: Sub-process /usr/bin/dpkg returned an error code (1)                     

typing模块如下图所示:

代码语言:javascript
复制
    ubuntu@ubuntu:~$ python3                                                    
    Python 3.4.3 (default, Nov 12 2018, 22:25:49)                               
    [GCC 4.8.4] on linux                                                        
    Type "help", "copyright", "credits" or "license" for more information.      
    > import typing                                                             
    > >>> from typing import Type                                               
    > >>> print(typing.__file__)                                                
    > /usr/local/lib/python3.4/dist-packages/typing.py                          
    > >>>                                                                                                                                                  

为什么它不工作?

EN

回答 1

Stack Overflow用户

发布于 2021-09-10 20:17:52

设置"CLOUDSDK_PYTHON_SITEPACKAGES=1“环境变量成功

代码语言:javascript
复制
ubuntu@ubuntu:~$ export CLOUDSDK_PYTHON_SITEPACKAGES=1
ubuntu@ubuntu:~$ sudo -E apt-get install google-cloud-sdk 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
google-cloud-sdk is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 172 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up google-cloud-sdk (356.0.0-0) ...
components post-process --force-recompile
WARNING:  Python 3.4.x is no longer officially supported by the Google Cloud SDK
and may not function correctly.  Please use Python version 2.7.x or 3.5 and up.

If you have a compatible Python interpreter installed, you can use it by setting
the CLOUDSDK_PYTHON environment variable to point to it.

ubuntu@ubuntu:~$ which gcloud
/usr/bin/gcloud
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69137524

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档