我想要一行
import dropbox
上班。我从Dropbox下载了Python Core API,并将zip文件的内容复制到我的(工作正常)应用程序的文件夹中。当我运行我的应用程序时,它会给我以下错误:
ERROR 2013-08-07 19:47:04,111 wsgi.py:219]
Traceback (most recent call last):
File "/home/myusername/Downloads/google_appengine/google/appengine/runtime/wsgi.py", line 196, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/home/myusername/Downloads/google_appengine/google/appengine/runtime/wsgi.py", line 255, in _LoadHandler
handler = __import__(path[0])
File "/home/myusername/Downloads/appname/appname.py", line 1, in <module>
import dropbox
File "/home/myusername/Downloads/appname/dropbox/__init__.py", line 3, in <module>
from . import client, rest, session
File "/home/myusername/Downloads/appname/dropbox/client.py", line 14, in <module>
from .rest import ErrorResponse, RESTClient
File "/home/myusername/Downloads/appname/dropbox/rest.py", line 7, in <module>
import pkg_resources
ImportError: No module named pkg_resources
如何解决此错误?
答案 0 :(得分:1)
如@Tim Dierks发布的链接所示,您可以通过在包含内容的dropbox文件夹中创建pkg_resouces模块来解决此问题
def resource_filename(*args):
cert_path = '/path/to/trusted-certs.crt'
return cert_path
据我所知,pkg_resources只需要一个返回证书路径的方法。 trusted-certs.crt应该在你的dropbox源文件夹中。
答案 1 :(得分:0)
您还需要将pkg_resources模块打包并分发到App Engine应用程序中。但是,从我在其他地方看到的情况来看,此后你会遇到其他一些挑战。看起来Writing files to Dropbox account from GAE的答案已经得到了解决(无论如何)。