我正在尝试安装GoogleCloudSDK,在安装过程中出现以下错误:

    Output folder: C:\Program Files (x86)\Google\Cloud SDK
Downloading Google Cloud SDK core.
Extracting Google Cloud SDK core.
Create Google Cloud SDK bat file: C:\Program Files (x86)\Google\Cloud SDK\cloud_env.bat
Installing components.
Welcome to the Google Cloud SDK!
ERROR: gcloud failed to load: 'ascii' codec can't decode byte 0xe1 in position 9: ordinal not in range(128)
    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
    from apitools.base.py import encoding as protorpc_encoding
    from apitools.base.py.base_api import *
    from apitools.base.py import http_wrapper
    from oauth2client.client import HttpAccessTokenRefreshError as TokenRefreshError  # noqa
    from oauth2client import crypt
    from oauth2client import _openssl_crypt
    from OpenSSL import crypto
    from OpenSSL import crypto, SSL
    from cryptography import x509
    from cryptography.x509.base import (
    from cryptography.x509.extensions import Extension, ExtensionType
    from asn1crypto.keys import PublicKeyInfo
    from ._elliptic_curve import (
    from ._int import inverse_mod
    from ._perf._big_num_ctypes import libcrypto
    libcrypto_path = find_library('crypto')
    fname = os.path.join(directory, name)
    result_path = result_path + p_path
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 executable:
    C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\python.exe
If it is not, please set the CLOUDSDK_PYTHON environment variable to point to a working Python 2.7 executable.
If you are still experiencing problems, please reinstall the Cloud SDK using the instructions here:
    https://cloud.google.com/sdk/
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\\bin\bootstrapping\install.py", line 8, in <module>
    import bootstrapping
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\bootstrapping\bootstrapping.py", line 17, in <module>
    import oauth2client.contrib.gce as gce
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\third_party\oauth2client\contrib\gce.py", line 25, in <module>
    from oauth2client import client
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\third_party\oauth2client\client.py", line 51, in <module>
    from oauth2client import crypt
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\third_party\oauth2client\crypt.py", line 45, in <module>
    from oauth2client import _openssl_crypt
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\third_party\oauth2client\_openssl_crypt.py", line 16, in <module>
    from OpenSSL import crypto
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\lib\site-packages\OpenSSL\crypto.py", line 12, in <module>
    from cryptography import x509
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\lib\site-packages\cryptography\x509\__init__.py", line 9, in <module>
    from cryptography.x509.base import (
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\lib\site-packages\cryptography\x509\base.py", line 16, in <module>
    from cryptography.x509.extensions import Extension, ExtensionType
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\lib\site-packages\cryptography\x509\extensions.py", line 13, in <module>
    from asn1crypto.keys import PublicKeyInfo
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\lib\site-packages\asn1crypto\keys.py", line 22, in <module>
    from ._elliptic_curve import (
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\lib\site-packages\asn1crypto\_elliptic_curve.py", line 51, in <module>
    from ._int import inverse_mod
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\lib\site-packages\asn1crypto\_int.py", line 56, in <module>
    from ._perf._big_num_ctypes import libcrypto
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\lib\site-packages\asn1crypto\_perf\_big_num_ctypes.py", line 31, in <module>
    libcrypto_path = find_library('crypto')
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\lib\ctypes\util.py", line 53, in find_library
    fname = os.path.join(directory, name)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\lib\ntpath.py", line 85, in join
    result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 9: ordinal not in range(128)
Failed to install.

我已经尝试了一些解决方案,包括将环境变量设置为Python 2.7安装,还有什么问题?
如果这有助于我已经在我的电脑中安装了默认Python3版本的anaconda navigator,那可能会导致冲突?

最佳答案

这似乎与SDK上的旧issue有关。我鼓励您按照submit a new defect report中的描述this article,以便对其给予适当的关注和重视。我们密切监视问题跟踪者。

关于python - Google Cloud'ascii'编解码器无法在安装过程中解码字节0xe1,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/48615607/

10-14 19:05
查看更多