Python 登录GCP SQL:如何确保导入PromptSession或以其他方式解决

Python 登录GCP SQL:如何确保导入PromptSession或以其他方式解决,python,bash,google-cloud-platform,google-cloud-sql,gcloud,Python,Bash,Google Cloud Platform,Google Cloud Sql,Gcloud,我正在尝试使用云Shell更新一些用户权限 alpha与相同 这是我在Cloud Shell中输入的第一件东西,所以我无法想象是什么破坏了PromptSession 如何解决此错误并使用Cloud Shell登录SQL Server?在尝试从Cloud Shell连接时很可能出现问题(我使用此命令从计算引擎实例连接);可能与Python运行时/环境变量有关。据报道。工程部已经意识到并正在调查此事 gcloud sql connect my-instance Whitelisting your I

我正在尝试使用云Shell更新一些用户权限

alpha与
相同

这是我在Cloud Shell中输入的第一件东西,所以我无法想象是什么破坏了PromptSession


如何解决此错误并使用Cloud Shell登录SQL Server?在尝试从Cloud Shell连接时很可能出现问题(我使用此命令从计算引擎实例连接);可能与Python运行时/环境变量有关。据报道。工程部已经意识到并正在调查此事

gcloud sql connect my-instance
Whitelisting your IP for incoming connection for 5 minutes...done.
Connecting to database with SQL user [sqlserver].********************************************************************************
Python command will soon point to Python v3.7.3.
Python 2 will be sunsetting on January 1, 2020.
See http://https://www.python.org/doc/sunset-python-2/
Until then, you can continue using Python 2 at /usr/bin/python2, but soon
/usr/bin/python symlink will point to /usr/local/bin/python3.
To suppress this warning, create an empty ~/.cloudshell/no-python-warning file.
The command will automatically proceed in  seconds or on any key.
********************************************************************************
> Password:
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/mssqlcli/main.py", line 117, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/mssqlcli/main.py", line 110, in main
    run_cli_with(mssqlcli_options)
  File "/usr/local/lib/python2.7/dist-packages/mssqlcli/main.py", line 43, in run_cli_with
    from mssqlcli.mssql_cli import MssqlCli
  File "/usr/local/lib/python2.7/dist-packages/mssqlcli/mssql_cli.py", line 18, in <module>
    from prompt_toolkit.shortcuts import PromptSession, CompleteStyle
ImportError: cannot import name PromptSession
2020/01/04 18:38:41 Rlimits for file descriptors set to {&{8500 1048576}}
2020/01/04 18:38:41 invalid json file "/tmp/tmp.s38C662KKr/legacy_credentials/me@gmail.com/adc.json": open /tmp/tmp.s38C662KKr/legacy_credentials/me@gmail.com/adc.json: no such file or directory
ERROR: (gcloud.beta.sql.connect) Failed to start the Cloud SQL Proxy.