[Translated]20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md

This commit is contained in:
GOLinux 2015-08-07 09:09:47 +08:00
parent 6d313b5254
commit dfa1d5bf87
2 changed files with 49 additions and 50 deletions

View File

@ -1,50 +0,0 @@
Translating by GOLinux!
Linux FAQs with Answers--How to fix “ImportError: No module named wxversion” on Linux
================================================================================
> **Question:** I was trying to run a Python application on [insert your Linux distro], but I got an error "ImportError: No module named wxversion." How can I solve this error in the Python program?
Looking for python... 2.7.9 - Traceback (most recent call last):
File "/home/dev/playonlinux/python/check_python.py", line 1, in
import os, wxversion
ImportError: No module named wxversion
failed tests
This error indicates that your Python application is GUI-based, relying on a missing Python module called wxPython. [wxPython][1] is a Python extension module for the wxWidgets GUI library, popularly used by C++ programmers to design GUI applications. The wxPython extension allows Python developers to easily design and integrate GUI within any Python application.
To solve this import error, you need to install wxPython on your Linux, as described below.
### Install wxPython on Debian, Ubuntu or Linux Mint ###
$ sudo apt-get install python-wxgtk2.8
### Install wxPython on Fedora ###
$ sudo yum install wxPython
### Install wxPython on CentOS/RHEL ###
wxPython is available on the EPEL repository of CentOS/RHEL, not on base repositories. Thus, first [enable EPEL repository][2] on your system, and then use yum command.
$ sudo yum install wxPython
### Install wxPython on Arch Linux ###
$ sudo pacman -S wxpython
### Install wxPython on Gentoo ###
$ emerge wxPython
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/importerror-no-module-named-wxversion.html
作者:[Dan Nanni][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://ask.xmodulo.com/author/nanni
[1]:http://wxpython.org/
[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html

View File

@ -0,0 +1,49 @@
Linux有问必答——如何修复Linux上的“ImportError: No module named wxversion”错误
================================================================================
> **问题** 我试着在[你的Linux发行版]上运行一个Python应用但是我得到了这个错误"ImportError: No module named wxversion."。我怎样才能解决Python程序中的这个错误呢
Looking for python... 2.7.9 - Traceback (most recent call last):
File "/home/dev/playonlinux/python/check_python.py", line 1, in
import os, wxversion
ImportError: No module named wxversion
failed tests
该错误表明你的Python应用是基于GUI的依赖于一个名为wxPython的缺失模块。[wxPython][1]是一个用于wxWidgets GUI库的Python扩展模块普遍被C++程序员用来设计GUI应用。该wxPython扩展允许Python开发者在任何Python应用中方便地设计和整合GUI。
To solve this import error, you need to install wxPython on your Linux, as described below.
### 安装wxPython到DebianUbuntu或Linux Mint ###
$ sudo apt-get install python-wxgtk2.8
### 安装wxPython到Fedora ###
$ sudo yum install wxPython
### 安装wxPython到CentOS/RHEL ###
wxPython可以在CentOS/RHEL的EPEL仓库中获取到而基本仓库中则没有。因此首先要在你的系统中[启用EPEL仓库][2]然后使用yum命令来安装。
$ sudo yum install wxPython
### 安装wxPython到Arch Linux ###
$ sudo pacman -S wxpython
### 安装wxPython到Gentoo ###
$ emerge wxPython
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/importerror-no-module-named-wxversion.html
作者:[Dan Nanni][a]
译者:[GOLinux](https://github.com/GOLinux)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://ask.xmodulo.com/author/nanni
[1]:http://wxpython.org/
[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html