【问题标题】:posting pic with python with twitpic fails使用带有 twitpic 的 python 发布图片失败
【发布时间】:2013-08-13 02:27:00
【问题描述】:

我正在尝试找到一种通过 twitpic.com 发布带有推文的图片的方法。有一个名为 twitpic 的 python 解决方案: https://github.com/macmichael01/python-twitpic

我已经在 linux 服务器上安装了这个,但恐怕我是 python 新手。

用法:twitpic [-h] [-m MESSAGE] consumer_key consumer_secret access_token service_key 文件

Python-TwitPic 命令行实用程序。

但是,当我使用我的凭据时,它会显示: twitpic -m bomengids xxxxxxxxxxxxxxxxx ...... T7hDxxxxxxxxxxxxxxxxx ...... Q 324319099-QYRpFFkAtPskJKh ...... bb7c3d68acb6d9。 ...... /root/pics/1.jpg

Traceback(最近一次调用最后一次): 文件“/usr/local/bin/twitpic”,第 23 行,在 service_key = opts.service_key, init 中的文件“/usr/local/lib/python2.6/dist-packages/twitpic/twitpic2.py”,第 139 行 self.access_token = oauth.OAuthToken.from_string(access_token) 文件“/usr/local/lib/python2.6/dist-packages/oauth/oauth.py”,第 142 行,在 from_string 键=参数['oauth_token'][0] KeyError: 'oauth_token'

这是什么意思?我该如何解决这个问题?

【问题讨论】:

  • 我开始认为这个 twitpic 库不适用于最新的 twitter api?

标签: python twitter twitpic


【解决方案1】:

README.md 文件 (https://github.com/macmichael01/python-twitpic/blob/master/README.md) 说 ""Command 还需要 python-2.7 才能使用。"。从回溯中,我看到您使用的是 Python 2.6 版。这可能是问题所在。

【讨论】:

    猜你喜欢
    • 2010-10-20
    • 2011-06-06
    • 1970-01-01
    • 2014-04-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-19
    • 1970-01-01
    相关资源
    最近更新 更多