login community faq

I've installed sorl-thumbnail via pip using the process outlined here:

http://docs.webfaction.com/software/python.html

First in the $HOME/lib/python2.7 by default, then, after removing it, in $HOME/webapps/myapp/lib/python2.7. I've verified that I have the "sorl" directory there as well as the egg, but whenever I run "python2.7 manage.py syncdb", I get:

Error: No module named sorl-thumbnail

I've tried adding:

1
2
import sys
sys.path = ["/home/rarnaoot/webapps/myapp/lib/python2.7", "/home/rarnaoot/webapps/myapp/lib/python2.7/sorl", "/home/rarnaoot/webapps/myapp/lib/python2.7/sorl/thumbnail"] + sys.path

directly to manage.py, as well as running:

PYTHONPATH=/home/rarnaoot/webapps/myapp/lib/python2.7:$PYTHONPATH python2.7 manage.py syncdb - I still get the error. Any suggestions on where to go from here?

asked Apr 21 '12 at 19:05

rarnaoot's gravatar image

rarnaoot
1

I have to remove 'sorl-thumbnail' from settings.py to be able to run the shell, but I can confirm that those specified directories are included:

['/home/rarnaoot/webapps/bellefour/lib/python2.7', '/home/rarnaoot/webapps/bellefour/lib/python2.7/sorl', '/home/rarnaoot/webapps/bellefour/lib/python2.7/sorl/thumbnail', '/home/rarnaoot/webapps/bellefour/bellefour', '/home/rarnaoot/lib/python2.7/pip-1.1-py2.7.egg', '/home/rarnaoot/lib/python2.7', '/home/rarnaoot/lib/python2.7', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/site-packages/PIL']

Is there some further directory I need to include?

(Apr 22 '12 at 11:27) rarnaoot rarnaoot's gravatar image

Isn't my face red. You're right, it's sorl.thumbnail not sorl-thumbnail. Thanks very much!

(Apr 22 '12 at 14:09) rarnaoot rarnaoot's gravatar image

I believe you need to have sorl.thumbnail in your settings.py not sorl-thumbnail.

http://thumbnail.sorl.net/installation.html#setup

answered Apr 22 '12 at 11:45

bmeyer71's gravatar image

bmeyer71 ♦♦
8512310

edited Apr 22 '12 at 11:48

To check if the module is on the path you first should check that the right path is getting set. Use manage.py's shell command,

1
python2.7 manage.py shell

Than use sys.path to check if the module is on the path,

1
2
>>>> import sys
>>>> print sys.path

answered Apr 21 '12 at 19:46

johns's gravatar image

johns ♦♦
340427

Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×643
×1

Asked: Apr 21 '12 at 19:05

Seen: 992 times

Last updated: Apr 22 '12 at 14:09

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited