I am on 14.04. The system python version is 2.7.6. I am testing a software meant for python 2.7.9. So I have a virtualenv running python 2.7.9.
Running this pip install wxpython
doesn't work. So I followed these steps here: Installing wxPython and wxWidgets on Ubuntu and Debian
Right now, I can import wx
using system python (2.7.6). But unable to do so using the virtualenv.
I tried building wxWidgets and wxPython from source using these instructions, but it failed with the following error:
In file included from src/helpers.cpp:17:0:
include/wx/wxPython/wxPython_int.h:35:19: fatal error: wx/wx.h: No such file or directory
#include <wx/wx.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
EDIT:
I tried another option: reinstall virtualenv with --system-site-packages
Eg.
virtualenv venv --system-site-packages
.
This however does not solve the problem as well. In my case, I have installed python 2.7.9 to ~/alternative/bin
,so running the following command still doesn't import wx into virtualenv:
virtualenv --system-site-packages -p ~/alternative/bin/bin/python2.7 my_venv