Hi all, Thank you once again for your insight and feedback.
I had gathered that Python2.4 is pretty old, but I guess I expected it on the CentOS5 box. This is the 'latest' as far as the CentOS official repos are concerned. Additionally, according to the Django v0.97 'INSTALL' readme, it's compatible with Python v2.3 or greater. Also, a bit more background which might help: - This 'hayley' website was originally created about 5 or 6 years ago by a third-party, and was built with Django v0.97 on an unknown platform (and unknown version of Python but I assume 2.3 or 2.4). - It was then moved temporarily to a Unbuntu11 box (where it is now), by another third party. It appears to have Python 2.6 and 2.7 installed. Running python from the command line launches v2.7.1. I have remote SSH root access to this box, but it's not my property and, being a production server, I don't want to mess it up! - I have now been asked to investigate moving it to an in-house server. As I am more familiar with CentOS than any other distro, and we had a CentOS5 server sitting around doing little else than hosting some samba shares, I decided to to try to port it here. I have checked the Django site, and have noted that Django v1.4.1 seems the latest, but I have also read that migrating a v0.97 Django project to Django v1.4.1 isn't straight-forward. I thought I could cut down on the hassle by staying with Django v0.97(!). I also assumed that with Django v0.97 being old, the older version of Python would be more appropriate/compatible. The suggestion that the version of sorl I am using is incompatible with python2.4 is a good call. I am going to look into uninstalling this and finding an older version. Failing that I will try and upgrade Python2.4 to v.27 on the CentOS box from an alternate repo. Cheers guys :) Elliot On Wednesday, October 3, 2012 4:57:49 PM UTC+1, Tom Evans wrote: > > On Wed, Oct 3, 2012 at 4:31 PM, Elliot > <elliot....@hayley-group.com<javascript:>> > 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 view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/FAlQ1AoMD9kJ. 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.