I am using the following code with Python 3.3 modules (installed using Pip3.3):
import simplejson
import httplib2
import twitter
api = twitter.Api(consumer_key='',
consumer_secret='',
access_token_key='',
access_token_secret='')
The specific modules installed are 'python-twitter 1.3.1' and it's dependencies 'httplib2 0.8', 'python-oauth2 0.6.0' and 'simplejson 3.3.3' which are all the most up to date versions on the PYPI directory.
I am receiving an error message pointing to line 56 of the twitter library though:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import twitter
File "C:\Python33\lib\site-packages\twitter.py", line 56
raise ImportError, "Unable to load a json library"
^
SyntaxError: invalid syntax
Above that module in the code is the following statements:
try:
# Python >= 2.6
import json as simplejson
except ImportError:
try:
# Python < 2.6
import simplejson
except ImportError:
try:
# Google App Engine
from django.utils import simplejson
except ImportError:
raise ImportError, "Unable to load a json library"
Does this mean that as I am Python version 3.3 that I also have to have a json library installed to make this code work? I haven't tried installing this yet as I don't want to confuse the issue further before asking for help.
Any ideas?
Thanks