# Upgrade from python26 to python27 didn't go well. How do I tell if it worked?



## bigtoque (Apr 24, 2011)

This all started out because I was reading about using new versions of GCC to improve binary performance (LibreOffice from ports takes ~4.5 seconds to load, but the precompiled package takes ~3 seconds). After reading I decided there wasn't any reason to mess around with other compilers since there's always the chance something will mess up. I decided to uninstall GCC 4.5 that I had installed a few months ago to install a port that required GCC 4.4 yet wouldn't compile unless I used 4.5.

It turns out that somehow a few programs on my system were now dependent on GCC 4.5:

math/blas
math/lapack
x11-toolkits/py-gtkglext
math/py-numpy
graphics/py-opengl

This let me to reading about updating python, so I followed the commands listed in /usr/ports/UPDATING, however when I ran:
[CMD=""]make upgrade-site-packages[/CMD]
I ran into a bunch of build errors.

I managed to get upgrade-site-packages to complete, however I've still got files in /usr/local/lib/python2.6/site-packages.

Is this fine? How do you tell if everything updated correctly?


----------



## jb_fvwm2 (Apr 25, 2011)

This is a rough draft, but if you correct its errors:

```
sh /etc/periodic/weekly/310.locate
(wait til completion)
locate n2.6 | grep site-pa | tee -a /tmp/py26.list
locate py26 | tee -a /tmp/py26.list
locate python | grep -v 27 | grep -v 2.7 | tee -a /tmp/py26.list
(examine the file in /tmp upgrade several or most, OR , change to obvious leftover python26 subdirectories...and)
(example, run the following in /usr/local/lib/python2.6 )
find . -type f -exec pkg_which {} \; | sort | uniq | tee -a /updPY.fil
then, you might have  a file /updPY.fil
which you could
cat /updPY.fil | head -4 | xargs -J % portmaster --update-if newer -d -B -P %
```
and edit out the top four lines before the next identical run. Convoluted, and the above might have a misplaced command, but if you have a lot of python26 leftover, that would (may) slowly migrate them all to python27.


----------

