Unable to import _winreg in Python 2.7.9 virtual environment

前端 未结 4 1417
执念已碎
执念已碎 2020-12-11 11:40

I\'m running an app engine application in a virtual environment on windows 7 64bit, python 2.7.9 x64.

Here\'s the stacktrace:

    p_system = platform         


        
4条回答
  •  攒了一身酷
    2020-12-11 12:19

    Module _winreg, as the docs say, exists to "expose the Windows registry API to Python".

    App Engine does not supply a "Windows registry API" (nor any other Windows-specific API). Therefore, its sandbox blocks attempts to import the module -- note, at the end of your stack trace, that the exception is deliberately raised in module sandbox.py of the App Engine SDK.

    Python's "virtual env" plays no part here -- it's all about App Engine.

    Please clarify what task you're trying to accomplish with _winreg once your GAE app is deployed -- assume it's deployed to Linux servers (although the GAE runtime doesn't supply Linux-specific APIs either:-), so there is no Windows Registry API anywhere in the neighborhood...

提交回复
热议问题