使用Google App Engine时的ImportError

时间:2021-10-26 23:14:12

When I add the following line to Google's helloworld example:

当我将以下行添加到Google的helloworld示例中时:

  from reportlab.pdfgen import canvas

I get the following error:

我收到以下错误:

  <type 'exceptions.ImportError'>: No module named reportlab.pdfgen 

I can get at the reportlab.pdfgen library from the python console. Why can't I get at it from google's dev_appserver?

我可以从python控制台获取reportlab.pdfgen库。为什么我不能从谷歌的dev_appserver获得它?

2 个解决方案

#1


Copying the module locally worked.

在本地复制模块工作。

From

Python\Lib\site-packages\reportlab

to

helloworld\reportlab 

#2


I believe the google app engine does not include all the standard python modules. I know that anything that works with sockes is disabled, such as urllib.urlopen().

我相信谷歌应用程序引擎不包括所有标准的python模块。我知道任何适用于sockes的东西都被禁用,比如urllib.urlopen()。

#1


Copying the module locally worked.

在本地复制模块工作。

From

Python\Lib\site-packages\reportlab

to

helloworld\reportlab 

#2


I believe the google app engine does not include all the standard python modules. I know that anything that works with sockes is disabled, such as urllib.urlopen().

我相信谷歌应用程序引擎不包括所有标准的python模块。我知道任何适用于sockes的东西都被禁用,比如urllib.urlopen()。