如何修复dev_appserver.py返回的错误

时间:2019-05-11 16:11:53

标签: python google-app-engine web localhost

请帮助! 这是我使用App Engine的第一个项目。我已使用所需文件创建了该应用程序。但是,当我尝试在云sdk cmd(和其他cmd程序)中启动服务器时,它返回与方法解析顺序(MRO)有关的错误。

我尝试从包含gcloud skd的文件夹(同时提供应用程序提供程序)和应用程序文件夹(c:\ path-to-app> dev_appserver.py)运行dev_appserver.py。 请查看以下错误:

D:\AMINU BISHIR\AMINU BISHIR\PROGRAMMING\Full Stack Web\Programs\my_app_engine>dev_appserver.py .
Traceback (most recent call last):
  File "C:\Users\Sadarwa\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\dev_appserver.py", line 14, in <module>
    from bootstrapping import bootstrapping
  File "C:\Users\Sadarwa\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\bootstrapping\bootstrapping.py", line 46, in <module>
    from googlecloudsdk.core.updater import update_manager
  File "C:\Users\Sadarwa\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\core\updater\update_manager.py", line 35, in <module>
    from googlecloudsdk.core import yaml
  File "C:\Users\Sadarwa\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\core\yaml.py", line 29, in <module>
    from googlecloudsdk.core import yaml_location_value
  File "C:\Users\Sadarwa\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\core\yaml_location_value.py", line 39, in <module>
    from ruamel import yaml
  File "C:\Users\Sadarwa\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\third_party\ruamel\yaml\__init__.py", line 85, in <module>
    from ruamel.yaml.main import *  # NOQA
  File "C:\Users\Sadarwa\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\third_party\ruamel\yaml\main.py", line 19, in <module>
    from ruamel.yaml.loader import BaseLoader, SafeLoader, Loader, RoundTripLoader  # NOQA
  File "C:\Users\Sadarwa\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\third_party\ruamel\yaml\loader.py", line 10, in <module>
    from ruamel.yaml.constructor import (
  File "C:\Users\Sadarwa\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\third_party\ruamel\yaml\constructor.py", line 21, in <module>
    from ruamel.yaml.comments import *                               # NOQA
  File "C:\Users\Sadarwa\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\third_party\ruamel\yaml\comments.py", line 642, in <module>
    class CommentedMap(MutableMapping, ordereddict, CommentedBase):
  File "C:\Python27\lib\abc.py", line 86, in __new__
    cls = super(ABCMeta, mcls).__new__(mcls, name, bases, namespace)
TypeError: Error when calling the metaclass bases
    Cannot create a consistent method resolution
order (MRO) for bases ordereddict, MutableMapping, CommentedBase

1 个答案:

答案 0 :(得分:0)

已解决!

谢谢大家的回应! 这对我有用:
1.仔细查看App Engine启动器的日志后,我发现该错误实际上来自python文件(该文件是python安装包的一部分)
2.我下载了最新版本的python 2(2.7.15)并安装了它 3.安装后,我就能解决问题了!
干杯,谢谢大家!