<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>HelpOnUpdatingPython</title></articleinfo><section><title>Updating Python</title><para>If you want to change the Python running your <ulink url="http://www.nnx.me/HelpOnUpdatingPython/MoinMoin#">MoinMoin</ulink> installation there are some issues to keep in mind: </para><section><title>Location of the MoinMoin directory</title><para>The default installation process (<code>setup.py</code>) installed the <ulink url="http://www.nnx.me/HelpOnUpdatingPython/MoinMoin#">MoinMoin</ulink> files into the site-packages directory of the current Python installation (for example <code>/usr/lib/python2.2/site-packages</code>). If you move to another Python interpreter you must reinstall the <ulink url="http://www.nnx.me/HelpOnUpdatingPython/MoinMoin#">MoinMoin</ulink> files into the new <code>lib/pythonX.X/site-packeges</code> directory. If you installed the <ulink url="http://www.nnx.me/HelpOnUpdatingPython/MoinMoin#">MoinMoin</ulink> files elsewhere and adjusted <code>sys.path</code> this is not a problem. </para></section><section><title>The precompiled Python files (.pyc)</title><para>Python does not grant that .pyc files are compatible between Python versions. If you change the Python interpreter you should recompile the Python scripts. You may use  </para><screen><![CDATA[python -c "import compileall; compileall.compile_dir('/path/to/MoinMoin')"]]></screen><para>for this. If you reinstall <ulink url="http://www.nnx.me/HelpOnUpdatingPython/MoinMoin#">MoinMoin</ulink> for the new interpreter the step is not needed/done by setup.py. </para></section><section><title>Empty Page Cache</title><para>The page cache uses Python byte code for faster page rendering. To avoid compatibility problems you should empty the cache by hand by deleting all files in <code>data/pages/*/cache/</code> and <code>underlay/pages/*/cache/</code>.  </para></section></section></article>