我想从Google App Engine调用markdown.markdown函数。我已经在模块文件夹中安装了markdown和pygments。
import modules.markdown as markdown
import modules.pygments as pygments
unistring = u'my string'
markdown.markdown(unistring, extensions=['codehilit'])我得到以下错误:
File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: Failed loading extension 'codehilite' from 'codehilite', 'markdown.extensions.codehilite' or 'mdx_codehilite'它似乎在GAE的主库文件夹中搜索模块。是否知道如何将其指向pygments文件夹的实际存储位置(modules.pygments)
发布于 2014-10-12 06:58:14
您可以在Google App Engine应用程序中使用任何纯Python第三方库。要使用第三方库,只需将文件包含在您的应用程序目录中,当您将其部署到我们的系统时,这些文件将随您的应用程序一起上传。您可以像导入应用程序中的任何其他Python文件一样导入这些文件。
只需在应用程序的目录中创建markdown和pygments符号链接,指向给定库。
https://stackoverflow.com/questions/26320045
复制相似问题