在 virtualenv 中安装 wx python

Install wx python in virtualenv

我有系统运行 UbuntuMate 16.04

我安装了 python 2.7 并且我在 virtualenv运行 python 3.5

在两者中,wx.version() returns

3.0.2.0 gtk2 (classic)

我想使用 wx.adv.DatePickerCtrl 但我无法导入 wx.adv 模块

我假设我需要从 classic 升级到 wx Phoenix。不幸的是,我就是不明白该怎么做。我已经按照 here 的安装说明,在 virtualenv

中使用以下命令
 pip install -U \
      -f https://extras.wxpython.org/wxPython4/extras/linux/gtk2/ubuntu-16.04 \
   wxPython

这会产生以下错误:

 Found existing installation: wxPython 3.0.2.0
 Cannot uninstall 'wxPython'. 
 It is a distutils installed project and thus we cannot 
 accurately determine which files belong to it which would 
 lead to only a partial uninstall.

我试图找到升级 wxPython 的方法,但这似乎是网络上沉默的话题

为了解决这个问题,我以 su 身份打开 caja 并重命名

/usr/lib/python2.7/dist-packges/wx-3.0-gtk2

然后我能够运行命令

sudo pip install -U \
  -f https://extras.wxpython.org/wxPython4/extras/linux/gtk2/ubuntu-16.04 \
wxPython

当然,这不仅在我的 virtualenv 中,而且在 HeyHo

中全局实现了 wxPython 的新版本