Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing wxPython in virtualenv under Linux

I am trying to set up a wxpython inside virtualenv. As detailed in many places, the easy_install / pip install dosent work as setup.py is not present.

I cam across a description on how to set it up on a Mac, but found no such methods for Linux.

How can this be done on Linux ?

My actual use case is a little experimental. I am trying to get a django project call a wxpython app. This works outside of virtualenv, but the import fails as wx is not installed in virtualenv.

Thanks for the help in advance.

like image 221
easwar Avatar asked Aug 08 '11 04:08

easwar


People also ask

Does wxPython work on Linux?

With wxPython software developers can create truly native user interfaces for their Python applications, that run with little or no modifications on Windows, Macs and Linux or other unix-like systems.


2 Answers

On Ubuntu 12.04 the following worked for me:

cd <env>/lib/python-2.7/site-packages
ln -s /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/ .
ln -s /usr/lib/python2.7/dist-packages/wx.pth .
ln -s /usr/lib/python2.7/dist-packages/wxversion.py .
ln -s /usr/lib/python2.7/dist-packages/wxversion.pyc .
like image 145
Luke Dunstan Avatar answered Oct 21 '22 08:10

Luke Dunstan


have you tried building it from source? it used to be a long process, but it looks like it's been improved recently. the instructions are at http://www.wxpython.org/builddoc.php and include the ability to specify an install directory. it builds fine on linux in my experience, once you have the dependencies installed.

like image 24
andrew cooke Avatar answered Oct 21 '22 07:10

andrew cooke