How to install wxPython using virtualenv How to install wxPython using virtualenv linux linux

How to install wxPython using virtualenv


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.


The solution I ended up using was to install python to my main system:

Then make a symbolic link from the wx in my system python to my virtual environment:

ln -s /usr/lib/python2.7/dist-packages/wxversion.py <virtual_env_path>/lib/python2.7/site-packages/wxversion.py

Where is the path in my case to a virtual environment named "fibersim" for example is:

/home/adam/anaconda/envs/fibersim

Then import wx worked

Got this from: http://qopml.org/wp-content/uploads/2013/01/README.txt


Buildout allows your to install different parts whose recipe code determines how that part is built. There are cmmi recipes for building stuff with Configure/Make/Make-Install (CMMI). You can use this to build wxPython locally to the buildout and then create a python interpreter that has that build of wxPython and your own eggs in it's path.

See this blog post and this answer for details.

Keep in mind that zc.recipe.egg will also install any setuptools/distribute console_scripts in the buildout's bin directory as well. See also mr.developer for automatically checking out multiple packages from VCS and working on them in the same buildout.