This page is for sharing knowledge on the process of building PyOgre from source on various linux distributions. If you've successfully installed pyogre on your distribution and don't see it represented here, put down what any pitfalls and/or solutions you encountered while getting it to work. Eventually we hope that this will help people package PyOgre for each distro.

All linux distributions


# Checkout this branch to get the current development branch
svn checkout http://svn.berlios.de/svnroot/repos/pyogre/branches/dev-1.2.0

# Checkout the trunk if you intend to use Ogre 1.0.6
svn checkout http://svn.berlios.de/svnroot/repos/pyogre/trunk

Build Ogre with GLX

Ogre will by default configure to use SDL, but as seen in this post, SDL isn't working perfectly with pyogre. Reported symptoms range from mild (program crashes on quit) to severe (program won't launch). To be safe, make sure to configure your ogre build using:

$ ./configure --with-platform=GLX

In the same post, it's said that pyogre may not play well with ATI graphics cards either, though this has yet to be confirmed.

The svn trunk is a liitle bit out-of-date, as it seems. I don't know anything about it and apologize in advance.
However this patch allow for the compilation
and successful installation.

There's a plugins.cfg file in the pyogre directory, but one line needs to be corrected, and you need to make links to it from any folder from which you want to run the demos.

In the current (30 Jan 2006) svn version of pyogre, pyogre/plugins.cfg looks like this:

# Define plugin folder
 PluginFolder=.
 # Define D3D rendering implementation plugin
 Plugin=RenderSystem_GL.so
 Plugin=Plugin_ParticleFX.so
 Plugin=Plugin_BSPSceneManager.so
 Plugin=Plugin_OctreeSceneManager.so
 Plugin=Plugin_CgProgramManager.so


You'll need to change the plugin folder to point to where all those plugin .so's actually are, namely /usr/local/lib/OGRE:

# Define plugin folder
 PluginFolder=/usr/local/lib/OGRE
 # Define D3D rendering implementation plugin
 Plugin=RenderSystem_GL.so
 Plugin=Plugin_ParticleFX.so
 Plugin=Plugin_BSPSceneManager.so
 Plugin=Plugin_OctreeSceneManager.so
 Plugin=Plugin_CgProgramManager.so


Finally, you'll need to link to this plugins.cfg file from any folder you intend to run pyogre from. For example, to run the demos from the demos/ogre/ folder, do the following

$ cd demos/ogre
 $ ln -s ../../pyogre/plugins.cfg

"python setup.py clean" is not enough

To recompile pyogre after a failed compile attempt, running "python setup.py clean" is not enough. You must also manually remove the ogre_wrap.cxx and ogre_wrap.h files from pyogre/ogre/, and cegui_wrap.cxx and cegui_wrap.h files from pyogre/cegui, if they were generated.

Ubuntu 5.10 ("breezy")

While all of the required external libraries exist in the apt-get repositories, a few of them are too old to be compatible with pyogre. You will need to deinstall these if you have them, and download and compile the most recent sources. These include

  • ogre (use 1.0.6)
  • cegui
  • swig


If your cegui was out of date, you'll need to recompile ogre with the new cegui.

To help the demos find the shared libraries, you'll need to do the following:

  • $ cd /etc
  • If there's no text file there called ld.so.conf, create one. Ubuntu doesn't come with this file.
  • In ld.so.conf, add the following lines:
/lib/
 /usr/lib/
 /usr/local/lib/
 /usr/X11R6/lib/

  • $ sudo ldconfig

Ubuntu (Dapper Drake)

Here's how I got PyOgre 1.0.6 working on Dapper Drake...

Get the dependencies:

$ sudo apt-get install build-essential
$ sudo apt-get install python-dev
$ sudo apt-get install libogre-dev
$ sudo apt-get install libcegui-mk2-dev
$ sudo apt-get install swig


NOTE: You'll need the Universe repository for some of these. As of when I wrote this, Ubuntu
will install OGRE 1.0.6; This won't work if you want to use the Ogre 1.2 features.

  • $ cd /etc
  • If there's no text file there called ld.so.conf, create one. Ubuntu doesn't come with this file.
  • In ld.so.conf, add the following lines:

/lib/
 /usr/lib/
 /usr/local/lib/
 /usr/X11R6/lib/
~/pp~

  • $ sudo ldconfig


The CEGUI Package provided in Dapper Drake seems to be missing the CEGUI OpenGL Renderer, so disable it:

The following changes can be found as a patch here.

In setup.py, find this line:
pkg_config_module='CEGUI CEGUI-OPENGL CEGUI-OGRE',
Change it to this:
pkg_config_module='CEGUI CEGUI-OGRE',

In (pyogre/cegui/)cegui.i, comment out this line:
%include CEGUIOpenGLRenderer.i
like this:
//%include CEGUIOpenGLRenderer.i

Then run setup.py:

$ sudo python setup.py install