Search code examples
pythonlinuxubuntuwxpythonvirtualenv

How to install wxPython using virtualenv


I am trying to begin a new python GUI application and I have decided to use wxPython as GUI because I want a multi-platform one.

The problem is that I want to use virtualenv ( with virtualenvwrapper ) to isolate the environment and be able to reproduce it in other machines where I will work, but i cannot install wxPython.

I have it installed in my ubuntu machine via apt-get but that is not enough

I have searched the web for a solution and i have found ...

  • This page http://batok.github.com/virtualenvwxp/ where it is explained a way to hack the virtualenv environment to use the local installation of wxPython. Not the best solution, but it would be a good workaround. The problem is that it is explained for Mac, and I couldnt make it work in my ubuntu.

  • Also found this page Installing wxPython in virtualenv under Linux where someone ask something similar. I have tried to build wxPython that way with no success.

Any help would be appreciated.

In the end, I have choose wxPython beacuse it is multiplatform and i can use it without license problems, but as i have not started yet i can change my mind if there is another easier to install framework.

Thanks In advance

20110925: Sorry for the delay and thanks for the answers. I just have tried to install wxpython using buildout and the links given here, but i still have the same problem. It seems as if I need libgtk2.0-dev package to be able to compile wxpython...

So there is any way to install this package locally to the buildout environment?

Thanks again.


Solution

  • At the end I could not resolve this problem.

    I want to create a reproducible python environment with all the requirements inside using buildout and/or virtualenv so I could work in any linux system with just virtualenv, python and a C++ compiler installed.

    It seems that the only way to do this is to use buildout cmmi recipes to download and build wxpython and ALL its dependencies. This is a really painful way, and I have no time now.

    I have decided to use a workaround: I am going to work on my ubuntu laptop most of the time, so I have installed wxpython from the repositories and use a wx.pth file to make it available to the virtual environment.

    This is not a good solution, but seems the best till now ... so if someone knows any better solution please let me know.

    When my python project is more mature, I will turn again to this problem and I will probably try the hard way ...

    Thanks for all your answers and comments.