加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python – 如何将Dropbox SDK导入Google App Engine应用程序?

发布时间:2020-12-20 13:36:27 所属栏目:Python 来源:网络整理
导读:我想要这条线 import dropbox 上班.我从Dropbox下载了Python Core API,并将zip文件的内容复制到我的(工作正常)应用程序的文件夹中.当我运行我的应用程序时,它给我以下错误: ERROR 2013-08-07 19:47:04,111 wsgi.py:219] Traceback (most recent call last):
我想要这条线

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

我该如何解决这个错误?

解决方法

如@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源文件夹中.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读