开发者

How GAE emulator limits list of available Python modules?

开发者 https://www.devze.com 2022-12-27 17:45 出处:网络
I installed Python Mock module using PIP. When I try to开发者_JAVA技巧 import mock running under \'dev_appserver\', GAE says that it can\'t find module \'mock\'.

I installed Python Mock module using PIP.

When I try to开发者_JAVA技巧 import mock running under 'dev_appserver', GAE says that it can't find module 'mock'.

import mock works perfectly in Python interpreter.

I understand that dev_appserver behaves absolutely correctly because I can't install modules with PIP on GAE servers.

My question is how technically dev_appserver filters list of modules that can be loaded?


The dev_appserver uses import hooks to prevent importing modules that shouldn't be available. The relevant code is here, but be warned - it's easily the most complicated bit of the dev_appserver!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号