1
votes

I'm trying to use sorl-thumbnail in my app.

However, when I'm trying to start manage runserver the following error occures:

File "/home/arie/PythonDevelopment/django-1.7/lib/python3.4/site-packages/sorl/thumbnail/helpers.py", line 55 except ImportError, e: ^ SyntaxError: invalid syntax

I'm using django 1.7 and python 3.4 on Ubuntu 14.04

2

2 Answers

3
votes

except Exception, e is not valid syntax in Python 3 any more.

Make sure you use an up-to-date version of solr-thumbnail, porting to Python 3 seems to have been taken care of and the syntax error from your question is not present in current master any more.

Django 1.7 compatibility seems to have been merged just recently, so you may need to use solr-thumbnail from source for now.

0
votes

pip install sorl.thumbnail doesn't actually get you python 3 support. The current beta version is much more recent. To install this version, uninstall and reinstall with:

pip uninstall sorl.thumbnail
pip install -I sorl-thumbnail=11.12.1b

Use pip show sorl.thumbnail to check the correct version is installed.