我在Windows上安裝了python 2.6。我剛安裝了Dropbox的API,當我做:安裝Dropbox API for Python 2.6時出現問題
import dropbox
它給出了一個錯誤:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build\bdist.win32\egg\dropbox\__init__.py", line 3, in <module>
# $Id$
File "build\bdist.win32\egg\dropbox\client.py", line 22, in <module>
File "C:\Python26\lib\site-packages\dropbox-2.2.0-py2.6.egg\dropbox\rest.py", line 415
utf8_params = {encode(k): encode(v) for k, v in params.iteritems()}
我能做些什麼?
重現也可以在Linux:
#> python
Python 2.6.5 (r265:79063, May 6 2011, 16:17:46)
[GCC 4.5.0 20100604 [gcc-4_5-branch revision 160292]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dropbox
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/site-packages/dropbox-2.2.0-py2.6.egg/dropbox/__init__.py", line 3, in <module>
from . import client, rest, session
File "/usr/local/lib/python2.6/site-packages/dropbox-2.2.0-py2.6.egg/dropbox/client.py", line 22, in <module>
from .rest import ErrorResponse, RESTClient, params_to_urlencoded
File "/usr/local/lib/python2.6/site-packages/dropbox-2.2.0-py2.6.egg/dropbox/rest.py", line 415
utf8_params = {encode(k): encode(v) for k, v in params.iteritems()}
^
SyntaxError: invalid syntax
任何你仍在使用Python 2.6的理由?現在這個版本已經6歲了。出於某種原因無法移動到Python 3的人傾向於使用Python 2.7,而其他人使用Python 3.3-3.5 – 2014-10-26 15:55:52
錯誤是什麼?它看起來像你粘貼堆棧跟蹤,但不是實際的錯誤消息。 – smarx 2014-10-26 17:11:50
@smarx不,這是不幸的完整的錯誤信息。沒有更多。我在使用Python 2.6的Linux下看到了同樣的問題。 – 2014-12-21 17:43:23