How do I 'install' a module on Google App Engine?

时光毁灭记忆、已成空白 提交于 2020-01-23 01:38:10

问题


Excuse me as I'm new to this. I've done all the searching I can, and while I know the module I want to install, I can't figure out how to install the specific module.

I'm wanting to install Python-OAuth2 to GAE, but as I can't find the specific oauth2.py file, I don't know what to copy into my app's directory on my machine (let alone if that will work).

What is the most direct way of installing third-party python modules on Google App Engine?


回答1:


For this particular case, copy the entire oauth2 directory to your app's folder. It should work.




回答2:


Modules in python are nothing but python files. Packages are directories that contain an __init__.py file. You can import a python file called foobar.py that resides in the same directory as the file you're importing from like so import foobar at which point you will get everything in foobar under the foobar. namespace.



来源:https://stackoverflow.com/questions/6010885/how-do-i-install-a-module-on-google-app-engine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!