ubuntu安装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.

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

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

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

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.

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

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

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.

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

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.

First make sure that you have Python installed

Install wxGTK 2.8 with the command, sudo apt-get install python-wxgtk2.8

Run the command, apt-get source -d wxwidgets2.8

Now run, dpkg-source -x wxwidgets2.8_2.8.12.1-6ubuntu2.dsc

cd wxwidgets2.8-2.8.12.1

cd wxPython

Now run the command, sudo python setup.py install

wxPython and wxWidgets are now successfully installed!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Ubuntu安装wxPython可以有几种方法。一种方法是使用pip进行安装。你可以在终端中执行以下命令来安装最新版本的wxPython: pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython [1] 如果这种方法不能正常工作,你可以尝试使用apt-get命令进行安装。首先,你可以在控制台中输入以下命令来搜索wxPython的信息: apt-cache search wxpython [2] 如果能够返回wxPython的信息,那么你可以使用以下命令来安装python-wxtools: sudo apt-get install python-wxtools [2] 另外,如果你的系统是CentOS 7或者Ubuntu 20,并且使用的是Python版本3.8,你也可以考虑安装robotframework-ride或者wxPython来满足你的需求。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [Python-Ubuntu安装wxpython](https://blog.csdn.net/wzhrsh/article/details/100987177)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [Ubuntu20安装wxPython](https://blog.csdn.net/yang5915/article/details/127182526)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值