On Wed, Oct 3, 2012 at 4:31 PM, Elliot <elliot.john...@hayley-group.com> wrote: > Hi guys, thank you sincerely for your feedback. > > As far as I know there is just the one instance of python installed: > > " >>>> print sys.path > ['', '/usr/lib/python2.4/site-packages/PIL-1.1.7-py2.4-linux-i686.egg', > '/usr/lib/python2.4/site-packages/sorl_thumbnail-11.12-py2.4.egg', > '/usr/lib/python24.zip', '/usr/lib/python2.4', > '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', > '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages', > '/usr/lib/python2.4/site-packages/Numeric', > '/usr/lib/python2.4/site-packages/gtk-2.0'] > > [root@svr-h001463 hayley]# whereis python > python: /usr/bin/python /usr/bin/python2.4 /usr/lib/python2.4 > /usr/include/python2.4 /usr/share/man/man1/python.1.gz > > [root@svr-h001463 hayley]# cd /usr/lib > [root@svr-h001463 lib]# ls -d */ | grep "py" > pygtk/ > python2.4/ > " > > If I try 'python manage.py shell': > " > [root@svr-h001463 hayley]# python manage.py shell > Traceback (most recent call last): > File "manage.py", line 11, in ? > execute_manager(settings) > File > "/usr/lib/python2.4/site-packages/django/core/management/__init__.py", line > 301, in execute_manager > utility.execute() > File > "/usr/lib/python2.4/site-packages/django/core/management/__init__.py", line > 248, in execute > self.fetch_command(subcommand).run_from_argv(self.argv) > File "/usr/lib/python2.4/site-packages/django/core/management/base.py", > line 77, in run_from_argv > self.execute(*args, **options.__dict__) > File "/usr/lib/python2.4/site-packages/django/core/management/base.py", > line 86, in execute > translation.activate('en-us') > File > "/usr/lib/python2.4/site-packages/django/utils/translation/__init__.py", > line 73, in activate > return real_activate(language) > File > "/usr/lib/python2.4/site-packages/django/utils/translation/__init__.py", > line 43, in delayed_loader > return g['real_%s' % caller](*args, **kwargs) > File > "/usr/lib/python2.4/site-packages/django/utils/translation/trans_real.py", > line 220, in activate > _active[currentThread()] = translation(language) > File > "/usr/lib/python2.4/site-packages/django/utils/translation/trans_real.py", > line 209, in translation > default_translation = _fetch(settings.LANGUAGE_CODE) > File > "/usr/lib/python2.4/site-packages/django/utils/translation/trans_real.py", > line 192, in _fetch > app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]), > appname[p+1:]) > File > "/usr/lib/python2.4/site-packages/sorl_thumbnail-11.12-py2.4.egg/sorl/thumbnail/__init__.py", > line 1, in ? > from sorl.thumbnail.fields import ImageField > File > "/usr/lib/python2.4/site-packages/sorl_thumbnail-11.12-py2.4.egg/sorl/thumbnail/fields.py", > line 61 > with open(data.temporary_file_path(), 'rb') as fp: > ^ > SyntaxError: invalid syntax > "
"with foo as bar" is a python 2.5 concept, so this version of django-sorl is not compatible with 2.4. They almost certainly changed it due to django itself no longer supporting python 2.4 after version 1.3. When you installed the packages on the new box, I suspect (particularly with packages you installed using easy_install) that you have installed newer versions of those packages than existed on the older box. If you can start from scratch (!), I would start using the tool 'pip' to discover what packages and versions you have on the old box, and install exactly those versions on the new box. You may have to install pip.. With pip installed, run "pip freeze" on the old box, which will output a list of all packages available in the current environment. On the new box, you can then run on the new box "pip install sorl-thumbnail==3.2.5", or whatever version you require. You might also want to look up virtualenv, which allows you to isolate python packages per application, allowing different environments to install different versions of the same package, and pip requirement files, which allow you to specify all libraries that an application needs to run. Combining the two gives you a simple file that defines all the dependencies required by an app, and a tool that can take that file and install them all into a disposable environment for the app - in effect, consistent 1 step setup. Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.