我正在尝试在我的本地计算机上启动并运行 Google 应用程序,但是,在运行设置脚本时遇到了问题。脚本出错并告诉我没有模块时间并且似乎正在中断 google-cloud-sdk....

我尝试过的事情:

  1. 在 Python 中导入时间(有效)
  2. 尝试此操作无济于事:https://apple.stackexchange.com/questions/96308/python-installation-messed-up

    Traceback (most recent call last): 
      File "/Users/kennethryan/Projects/go-edu-store/y/google-cloud-sdk/platform/google_appengine/_python_runtime.py", line 83, in <module> 
    _run_file(__file__, globals()) 
      File "/Users/kennethryan/Projects/go-edu-store/y/google-cloud-sdk/platform/google_appengine/_python_runtime.py", line 79, in _run_file 
    execfile(_PATHS.script_file(script_name), globals_) 
      File "/Users/kennethryan/Projects/go-edu-store/y/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/runtime.py", line 175, in <module> 
    main() 
      File "/Users/kennethryan/Projects/go-edu-store/y/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/runtime.py", line 155, in main 
    sandbox.enable_sandbox(config) 
      File "/Users/kennethryan/Projects/go-edu-store/y/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 183, in enable_sandbox 
    __import__('%s.threading' % dist27.__name__) 
      File "/Users/kennethryan/Projects/go-edu-store/y/google-cloud-sdk/platform/google_appengine/google/appengine/dist27/threading.py", line 13, in <module> 
    from time import time as _time, sleep as _sleep 
      File "/Users/kennethryan/Projects/go-edu-store/y/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 984, in load_module 
    raise ImportError('No module named %s' % fullname) 
      ImportError: No module named time 
    

这是我当前的 $PATH:

/Users/kennethryan/Projects/go-edu-store/y/google-cloud-sdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 

请您参考如下方法:

鉴于这是一个存在已久的非活跃问题,我们可以假设通过运行“gcloud components update”将 Google Cloud 工具更新到最新版本将解决此问题。

还要确保您使用的是 GCloud 提供的 Python 安装,并且没有冲突的“CLOUDSDK_PYTHON”环境变量应该可以防止这种情况发生。


如果以后再遇到这个问题,建议直接反馈给Google Public Issue Tracker这样就可以妥善处理并将其分类给 GCloud 工程团队。


评论关闭
IT干货网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!