WebFaction
Community site: login faq

I have a very old version of Trac (0.12, I think, which ran on Python 2.4, it seems) that I'd like to upgrade. I tried following the upgrade instructions here. That wouldn't work since the version of Python in the trac/lib directory is 2.4. So I tried using the following command which almost works:

PYTHONPATH=$PWD/lib/python2.4 easy_install-2.6 -Z -d $PWD/lib/python2.4 -s $PWD/bin pysqlite trac==1.2

But I get the following error:

Creating /home/tmciver/webapps/trac/lib/python2.4/site.py
Searching for pysqlite
Reading https://pypi.python.org/simple/pysqlite/
Best match: pysqlite 2.8.3
Downloading https://pypi.python.org/packages/42/02/981b6703e3c83c5b25a829c6e77aad059f9481b0bbacb47e6e8ca12bd731/pysqlite-2.8.3.tar.gz#md5=033f17b8644577715aee55e8832ac9fc
Processing pysqlite-2.8.3.tar.gz
Writing /tmp/easy_install-or8OJP/pysqlite-2.8.3/setup.cfg
Running pysqlite-2.8.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-or8OJP/pysqlite-
2.8.3/egg-dist-tmp-E1t7mI
Only Python 2.7 is supported.
error: Setup script exited with 1

I am open to doing a fresh install rather than an upgrade but I'd like to save my old data if possible.

asked 07 Jan, 01:23

tmciver
238
accept rate: 0%


Hello,

You may want to try building python2.4 binary since it is no longer on the servers by default.

mkdir ~/src
cd ~/src
wget https://www.python.org/ftp/python/2.4.6/Python-2.4.6.tgz
tar zxf Python-2.4.6.tgz
cd Python-2.4.6
./configure --prefix=$HOME/opt
make
make install
cd ~/src
wget https://pypi.python.org/packages/61/3c/8d680267eda244ad6391fb8b211bd39d8b527f3b66207976ef9f2f106230/setuptools-1.4.2.tar.gz
tar zxf setuptools-1.4.2.tar.gz
cd setuptools-1.4.2
~/opt/bin/python setup.py install

If you still want to try with python2.6 you could try using a lower version with easy_install

permanent link

answered 07 Jan, 02:24

johns ♦♦
5.2k211
accept rate: 22%

@johns I ran the above commands which ran without error. I wasn't entirely sure which command I'm now supposed to run to upgrade trac but I ran the following:

$ PYTHONPATH=~/opt/bin/python easy_install-2.6 -Z -d $PWD/lib/python2.4 -s $PWD/bin pysqlite trac==1.2

and got the following error:

TEST FAILED: /home/tmciver/webapps/trac/lib/python2.4 does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from.  The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

    /home/tmciver/webapps/trac/lib/python2.4

and your PYTHONPATH environment variable currently contains:

    '/home/tmciver/opt/bin/python'

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment variable.  (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by using one of the approaches described here:

  https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations

Please make the appropriate changes for your system and try again.`

I guess I need to use python 2.6. I'm not very familiar with python; what command is needed for that?

(07 Jan, 20:44) tmciver

The command to run Python 2.6 is python2.6.

Also, when you set your PYTHONPATH, don't use the tilde shortcut for your home directory. Instead, use the full path or use the $HOME environment variable.

I hope this helps!

(07 Jan, 22:28) seanf

OK, I believe I was able to upgrade Trac by using the following command:

PYTHONPATH=$PWD/lib/python2.7 easy_install-2.7 -Z -d $PWD/lib/python2.7 -s $PWD/bin pysqlite trac==1.2

and following the rest of the instructions at the above mentioned Webfaction Trac upgrade link. The problem now is that I get a 500 when attempting to visit the site and when I look at ~/logs/frontend/error_trac_php.log, I see the following messages:

AH01215: /bin/env: python2.4: No such file or directory
End of script output before headers: trac.cgi
AH01215: /bin/env: python2.4: No such file or directory, referer: http://trac.timmciver.com/
End of script output before headers: trac.cgi, referer: http://trac.timmciver.com/

Do I have to tell Trac not to use Python 2.4?

(08 Jan, 01:40) tmciver

You will need to update any hardcoded references to 2.4, the most important being the cgi-bin/trac.cgi file

(08 Jan, 10:46) iliasr ♦♦

@iliasr Doh! Yeah, I only needed change the hard-coded reference to Python 2.4 in cgi-bin/trac.cgi. Thanks.

@johns Is it OK if I create and accept my own answer after outlining exactly what I did? I figure it will be helpful for posterity. :) I'll upvote this answer as well.

(08 Jan, 15:55) tmciver
Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×39
×25

question asked: 07 Jan, 01:23

question was seen: 384 times

last updated: 08 Jan, 15:55

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM