在Ubuntu 12.04上安装wxPython

问题描述:

问题:我无法在Ubuntu 12.04上安装wxPython。

The Issue: I am having trouble installing wxPython on Ubuntu 12.04. I would like to find a simple, straightforward way of doing this.

我已经做了甚么:到目前为止,我能够找到的最相关的指示可以在这里找到: http://wiki.wxpython。 org / InstallationOnUbuntuOrDebian

What I've Done So Far: The most relevant instructions that I have been able to find so far can be found here: http://wiki.wxpython.org/InstallingOnUbuntuOrDebian

这些说明的问题是Precise 12.04无法选择。最新的发行版是Natty 11.4。从我可以找到的,正确的方法是手动构建debian软件包,这在这里解释: http: /wiki.wxpython.org/BuildingDebianPackages

The issue with these instructions is that there is no choice available for Precise 12.04. The most up-to-date distro shown is Natty 11.4. From what I can find, the proper way to do this is to manually build debian packages, which is explained here: http://wiki.wxpython.org/BuildingDebianPackages

尝试此操作,最后输入命令fakeroot debian / rules binary时,我收到错误: p>

Upon attempting this and finally typing the command 'fakeroot debian/rules binary', I get the errors:


debian / rules:14:/usr/share/quilt/quilt.make:没有这样的文件或目录

pyversions :在控制文件中丢失X(S)-Python版本,回到debian / pyversions

pyversions:丢失debian / pyversions文件,返回支持的版本

make:* **没有规定使目标`/usr/share/quilt/quilt.make'。停止。

debian/rules:14: /usr/share/quilt/quilt.make: No such file or directory
pyversions: missing X(S)-Python-Version in control file, fall back to debian/pyversions
pyversions: missing debian/pyversions file, fall back to supported versions
make: *** No rule to make target `/usr/share/quilt/quilt.make'. Stop.

我似乎无法修复此错误,或找到适用于我的任何其他适用的资源。我会在这里发布更多链接,但由于我是新的,垃圾邮件过滤器阻止我这样做。

I cannot seem to fix this error, or find any other applicable resources that work for me. I would post more links here, but since I am new, the spam filter is blocking me from doing so.

结论:有人知道在Ubuntu 12.04上正确安装wxPython的简单解决方案精确?

Conclusion: Does someone know a simple solution to properly installing wxPython on Ubuntu 12.04 Precise?

更新:我只是简单地使用apt -get命令'sudo apt-get install python-wxgtk2.8',并且我收到这个(这似乎很好):

Update: I tried just simply using the apt-get command 'sudo apt-get install python-wxgtk2.8', and I received this (which seems good):


阅读包列表...完成

构建依赖关系树


读取状态信息...完成

python-wxgtk2.8已经是最新版本。

以下软件包已自动安装,不再需要:

language-pack-zh-hans yaml-cpp language-pack-kde-en language-pack-kde-zh -hans language-pack-kde-en-base language-pack-zh-hans-base language-pack-kde-zh-hans-base

使用'apt-get autoremove'去除它们。 br>
0升级,0新安装,0到删除ve和173未升级。

Reading package lists... Done
Building dependency tree

Reading state information... Done
python-wxgtk2.8 is already the newest version.
The following packages were automatically installed and are no longer required:
language-pack-zh-hans yaml-cpp language-pack-kde-en language-pack-kde-zh-hans language-pack-kde-en-base language-pack-zh-hans-base language-pack-kde-zh-hans-base
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 173 not upgraded.

但是一旦我尝试运行某些东西,即'python test_gui.py',我得到以下错误:

But once I attempt to run something, ie 'python test_gui.py', I get the following error:


追溯(最近呼叫最后):

文件test_gui.py,第1行, br>
import wx

ImportError:没有名为wx的模块

Traceback (most recent call last):
File "test_gui.py", line 1, in
import wx
ImportError: No module named wx


好的,所以我能弄清楚。原来是一个组合的东西。

Okay, so I was able to figure it out. It turned out to be a combination of things.


  1. 首先确保你安装了Python

  2. 使用命令安装wxGTK 2.8 sudo apt-get install python-wxgtk2.8

  3. 运行命令 apt-get source -d wxwidgets2.8

  4. 现在运行 dpkg-source -x wxwidgets2.8_2.8.12.1 -6ubuntu2.dsc

  5. cd wxwidgets2.8-2.8.12.1

  6. cd wxPython

  7. 现在运行命令, sudo python setup.py install

  8. wxPython和wxWidgets现已成功安装!

  1. First make sure that you have Python installed
  2. Install wxGTK 2.8 with the command, sudo apt-get install python-wxgtk2.8
  3. Run the command, apt-get source -d wxwidgets2.8
  4. Now run, dpkg-source -x wxwidgets2.8_2.8.12.1-6ubuntu2.dsc
  5. cd wxwidgets2.8-2.8.12.1
  6. cd wxPython
  7. Now run the command, sudo python setup.py install
  8. wxPython and wxWidgets are now successfully installed!