wxpython-GUI-python搭建配置_on.squeeze(Debian)
.....
############################
http://wiki.wxpython.org/InstallingOnUbuntuOrDebian
Installing wxWidgets and wxPython On Ubuntu Or Debian
There are wxWidgets and wxPython packages in the standard software repositories for Debian and Ubuntu, but they are usually at least a few releases behind the current release, and in some cases many releases behind. Since many users prefer to use only packages installed from repositories (for easier package management) but still would like to have newest versions possible of their installed software, we have our own APT repository that is usually updated within a few days of each release. To use it to be able to keep your wx on the cutting edge release just follow these instructions.
- The packages and the repository meta-data are digitally signed, so you'll need to import the key into your apt's list of trusted keys in order to not get warnings about it.
curl http://apt.wxwidgets.org/key.asc | sudo apt-key add -
-
Add the following lines to your /etc/apt/sources.list file (or use the "software sources" program under the "system" menu). Replace the "DIST" text with whatever is appropriate for your system. (See the table below for a list of supported distributions and architectures.)
# wxWidgets/wxPython repository at apt.wxwidgets.org deb http://apt.wxwidgets.org/ DIST-wx main deb-src http://apt.wxwidgets.org/ DIST-wx main
For example, if your distro is Ubuntu Gutsy, then you would use the following configuration statements:
# wxWidgets/wxPython repository at apt.wxwidgets.org deb http://apt.wxwidgets.org/ gutsy-wx main deb-src http://apt.wxwidgets.org/ gutsy-wx main
- Run the this command to update your local copy of the package meta-data.
sudo apt-get update
-
You can now use your favorite package selection tool to install or upgrade the wxWidgets and wxPython packages. Here's how to do it with apt-get:
sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n
The packages libwxgtk2.8-dev and libgtk2.0-dev may need to be installed if a 3rd party application requires wxWidgets when building from source.
sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n libwxgtk2.8-dev libgtk2.0-dev
These packages (and their dependencies) will replace earlier versions of wxPython and wxGTK in the same ReleaseSeries that may have been installed previously. There are a few other wx packages as well, but those listed above and their dependencies are the core that are needed for use with wxPython.
Supported Distributions and Architectures
At a terminal, enter "lsb_release -a" to print what version of Ubuntu you have.
There are currently packages in the repository for these Ubuntu releases and architectures:
Release |
DIST name |
Architectures |
Python Versions |
Latest wx |
Ubuntu 6.06 |
dapper |
i386, amd64 |
2.4 |
2.8.8.0 |
Ubuntu 6.10 |
edgy |
i386, amd64 |
2.4, 2.5 |
2.8.6.1 |
Ubuntu 7.04 |
feisty |
i386, amd64 |
2.4, 2.5 |
2.8.9.1 |
Ubuntu 7.10 |
gutsy |
i386, amd64 |
2.4, 2.5 |
2.8.9.2 |
Ubuntu 8.04 |
hardy |
i386, amd64 |
2.4, 2.5 |
2.8.10.1 |
Ubuntu 8.10 |
intrepid |
i386, amd64 |
2.4, 2.5 |
2.8.10.1 |
Ubuntu 9.04 |
Jaunty |
i386, amd64 |
2.5, 2.6 |
2.8.11.0 |
Ubuntu 9.10 |
karmic |
i386, amd64 |
2.5, 2.6 |
2.8.11.0 |
Ubuntu 10.4 |
lucid |
i386, amd64 |
2.6 |
2.8.12.0 |
Ubuntu 10.10 |
maverick |
i386, amd64 |
2.6 |
2.8.12.0 |
Ubuntu 11.4 |
natty |
i386, amd64 |
2.6, 2.7 |
2.8.12.0 |
Debian 4.0 |
etch |
i386, amd64 |
2.4 |
2.8.12.0 |
Debian 5.0 |
lenny |
i386, amd64 |
2.4, 2.5 |
2.8.12.0 |
Debian 6.0 |
squeeze |
i386, amd64 |
2.5, 2.6 |
2.8.12.0 |
Notes
- When multiple Python versions are listed in the table above then that means that the wxPython package supports all of the listed versions of Python at the same time. This is accomplished using the pycentral debhelper, so the wxPython package is only built this way if pycentral is available and if it says that more than one version of Python should be supported.
-
If you don't see the release or architecture that you need here you can get the source package and build your own set of binary packages. SeeBuildingDebianPackages for a how-to.
-
Starting with the 2.8.7.1 release this repository also contains packages for the ansi build of wxWidgets, all with an "-ansi" in their name. See UnicodeBuild for what this means.
- If you get errors during the package installation stating that the package relies on future versions of libc, libstdc++ etc, then you have likely chosen the wrong distribution, probably a later one than you actually have.
##############################
http://www.cnblogs.com/datasci/archive/2009/03/21/1418666.html
install wxpython on ubuntu
安装还是很方便的,先看下系统能否找到wxPython,键入如下命令:
sudo apt-cache search wxpython
如果能够正确返回wxPython的信息就好办了,直接键入如下命令就可以安装了:
sudo apt-get install python-wxtools
http://blog.sina.com.cn/s/blog_48e122970100el1n.html
ubuntu 8.10中安装wxpython, cmake, python-vtk
(2009-08-28 10:13:55)标签:
wxpythonubuntupython-vtkcmake |
分类: python |
ubuntu 8.10中已经自带了python2.5,地址在/usr/bin/python2.5
Installing wxPython
- Run
sudo apt-get update
. Once the update finishes, - run
sudo apt-get install python-wxgtk2.8 python-wxtools
.
Now you have successfully installed
ubuntu 8.10中已经自带了cmake, you can search it in the Synaptic Package Manager(新立得)
sudo apt-get install cmake
sudo apt-get install python-vtk
=================================================
http://hi.baidu.com/27270543/blog/item/f05b1afcf804bdf6fd037f7b.html
apt-cache search wxpython
如果能够正确返回wxPython的信息就好办了,直接键入如下命令就可以安装了:
sudo apt-get install python-wxtools
如果显示找不到wxPython的话可以查看《Installing wxWidgets and wxPython On Ubuntu Or Debian》一文,但你想快速查看方法可以直接看下面的命令,不过下面的命令我没有试验过,所以错了不要找我。请依次键入如下命令:
curl http://apt.wxwidgets.org/key.asc | sudo apt-key add -
deb http://apt.wxwidgets.org/ gutsy-wx main
deb-src http://apt.wxwidgets.org/ gutsy-wx main
sudo apt-get update
sudo apt-get install python-wxgtk2.8 python-wxtools python-wxaddons wx2.8-i18n
#########################################
http://wiki.wxpython.org/How%20to%20install%20wxPython
How to install wxPython
目录
Install Python
You should have already done that. Refer to the Python website to have some more information. BUILD.unix is probably the helpfile you are looking for.
Windows
Installation under windows is especially simple: Run the installer you can get from wxPython and follow the instructions.
Mac OS X
An installer is available on the wxPython site, for both PPC and Intel Macs.
If you wish to build it yourself, you should follow the instruction described here.
A french howto can be found here
Linux - Redhat
You can find RPMs for Redhat (they are working just fine with Mandrake through), at the address wxPython
Linux - Debian
wxPython can be installed through apt-get by calling apt-get install python-wxgtk2.8 or apt-get install python-wxgtk2.6, depending on which version you want. The wxPython demo is in the wx-examples package. However, it is advised to install the demo separately, as described at Using wxPython Demo Code
Please note that sometimes older versions of wx are installed by using this method See InstallingOnUbuntuOrDebian for how to get the latest versions with apt-get
Linux - Gentoo
wxPython can be installed through portage by calling emerge wxPython (notice the capital P). The correct command is actually emerge wxpython (without a capital p) as of 11/28/04.
Linux - Building from the source
You might also want to build wxPython from the source. You have to do this in three steps:
Installing wxGTK from source
wxGTK is the GTK version of wxWidgets. GTK (Gimp ToolKit) is a graphic library used by Gnome, so it is probably already installed on your Linux box. All you have to do is download the wxGTK source from the wxGTK ftp server. Or the wxWidgets website
- Untar wxGTK by type the command:
tar -xvzf wxGTK-2.2.5.tar.gz
- Go into the directory:
cd wxGTK-2.2.5
- Run the configure script:
./configure --with-gtk
You might get some errors here if GTK is not installed or if the include files for GTK are not installed (in a Mandrake distribution, gtk+-devel-1.2.8-6mdk.i586.rpm is the rpm that you want to install)
- Run the make file:
make
- You might get some errors here if yacc or lex are not installed. (in a Mandrake distribution, the right rpms are byacc-1.9-7mdk.i586.rpm and flex-2.5.4a-13mdk.i586.rpm)
You should now have a compiled version of wxGTK. We want to install it and link it into the system.
- Become superuser:
su
Your root password is required here.
- Install wxGTK:
make install
- Link the library:
ldconfig
- Exit from superuser mode:
exit
Normally, wxGTK is installed but there might be a problem with wxPython:
it is possible that the library is not installed where wxPython is looking for it. ( In a mandrake 7.2 distribution, you want wxGTK to be installed in /usr/lib whereas it is automatically installed in /usr/local/lib) The solution is to create a symbolic link of the library where you want it to be:
- Go in to the directory where you want the library to be installed:
cd /usr/lib
- Create a symbolic link to the library:
ln -s /usr/local/lib/libwx_gtk.so
Installing wxPython from source
- Download the source code of the last wxPython release:
- Untar the tarball:
tar -xvzf wxPython-2.2.5.tar.gz
- go into the directory:
cd wxPython-2.2.5
- Edit the setup.py to choose what you want to install. I suggest that you don't install OGL and GL_CANVAS. by selecting:
BUILD_GLCANVAS = 0 # If true, build the contrib/glcanvas extension module BUILD_OGL = 0 # If true, build the contrib/ogl extension module BUILD_STC = 1 # If true, build the contrib/stc extension module CORE_ONLY = 0 # if true, don't build any of the above GL_ONLY = 0 # Only used when making the -gl RPM. See the "b" script # for the ugly details USE_SWIG = 0 # Should we actually execute SWIG, or just use the # files already in the distribution? IN_CVS_TREE = 0 # Set to true if building in a full wxWidgets CVS # tree, otherwise will assume all needed files are # available in the wxPython source distribution
- Build the python module:
python setup.py build
- Become root:
su
Your root password is required here.
- Install the module:
python setup.py install
- Exit root mode:
exit
- Check if the module works:
[lucas@b007 wxPython-2.2.5]$ python Python 1.5.2 (#1, Sep 30 2000, 18:08:36) [GCC 2.95.3 19991030 (prerelease)] on linux-i386 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import wx >>>
wxPython is fully installed!
##################################################
http://www.wxpython.org/download-2.6.4.0.php
Prerequisites |
Like any other complex piece of software, wxPython requires other software in order to function properly. Obviously you'll need Python itself, but if you're reading this you've probably already got Python and are just here looking for the best GUI toolkit available for Python. Check out the details for your platform of choice here:
Win32
Mac OS X
|
Prebuilt Binaries NOTE: The links below are for the binaries and source for wxPython 2.6.4.0. Prior versions are available atSourceForge. NOTE 2: wxPython now supports having more than one wxPython runtime installed at the same time, and provides a mechanism for choosing a non-default version at runtime if the app needs to. Please read MultiVersionInstalls for all the gory details. |
|||||||||||||||||||||
Microsoft Windows The Win32 version of wxPython is distributed as a set of standard self-installing executables. This allows you the convenience of using the Start Menu and Add/Remove Programs just like any other Windows software. There are two versions of wxPython for each of the supported Python versions on Win32. They are nearly identical, except one of them has been compiled with support for the Unicode version of the platform APIs. If you don't know what that means then you probably don't need the Unicode version, get the ANSI version instead. The Unicode verison works best on Windows NT/2000/XP. It will also mostly work on Windows 95/98/Me systems, but it is based on a Microsoft hack called MSLU (or unicows.dll) that translates unicode API calls to ansi API calls, but the coverage of the API is not complete so there are some difficult bugs lurking in there.
If you have a need to compile other Python extension modules or applications that link with the same version of the wxWidgets DLL that wxPython does, then you will want to get the development package. It includes a snapshot of the wx headers and the import libraries found on my system when I made the wxPython binaries.
|
|||||||||||||||||||||
Mac OS X The Max OSX version of wxPython is distributed as a set of mountable disk images. The runtime verisons contain Installer packages, as well as a script that can perform an uninstall of previous installs of wxPython. (NOTE: If you have versions prior to 2.5.3.1 installed please do run the uninstaller to remove the older version.) Not sure if you should use the ANSI or Unicode version? Read here for more info. Using Tiger and Python 2.3? You must install this fix before installing wxPython if you haven't already. Got an Intel Mac? Universal Binaries for Tiger are available below. You will need the Universal MacPython available from Python.org to run this build. As for why they only run on Tiger, please see this note.
PPC Binaries
|
|||||||||||||||||||||
Linux RPMs Several flavors of wxPython RPMs are available for various RPM based Linux distributions. If there isn't a set of RPMs below for your particular distro and Python version then you can try one of them that is similar to your distro as they will often work. Otherwise there is a source RPM (as well as a source tarball and an RPM spec file) that will allow you to build your own set of RPMs.
|
|||||||||||||||||||||
Debian Debian users can get wxPython from the Debian pacakge distribution system and can be installed with apt-get. Look for packages named python-wxgtkX.Y where X.Y is the major version numbers. NOTE: The wxPython packages in Debian 'stable' are way behind the times, so you'll want to look at either 'testing' or 'unstable' for newer pacakges. Alternatively you can build your own Debian packages from sources if you have the necessary tools and libs installed on your system. You can either do it from the source RPM using alien, as describedhere, or you can build directly from the source tarball. (Instructions still to be written...) Ubuntu # wxPython repository on Starship deb http://starship.python.net/crew/robind/wxPython/apt/ binary/ deb-src http://starship.python.net/crew/robind/wxPython/apt/ source/After the repository info has been added to /etc/apt/sources.list you can fetch and install the packages using one of the GUI package manager tools such as Synaptic or Adept, or by running the following commands from a terminal window: sudo apt-get update sudo apt-get install python-wxgtk2.6 python-wxtools wx2.6-i18nThese packages (and their dependencies) will replace earlier versions of wxPython and wxGTK that may have been installed previously from the Ubuntu repositories. |
|||||||||||||||||||||
Documentation This is the wxWidgets/wxPython documentation, in HTML format. For other documentaion options see the wxWidgets site. Thre is an effort underway to create a Python-specific set of reference docs for wxPython. While much of the content is not yet present, the docs are still usable, and in fact helpful since they already accurately document what classes and methods are present in wxPython and what the parameter names are. A downloadable archive of the new docs is now made as part of the release builds, and it can also be accessed online here.
|
|||||||||||||||||||||
Demo and Sample Apps Since the RPMs no longer include the demo or samples, it is now packaged separately. Why did I do this? Well the demo is intended to be a learning tool, but when installed from the RPM all the demo files are owned by root. As a separate tarball you can put the files where ever you want and since they'll be owned by you when you untar them you can play and tweak to your heart's desire.
|
Source Code |
Released Sources Here are the wxPython sources and all you'll need (besides the prerequisites outlined above) to build wxPython on Win32, Unix or OS X systems, including the sources for wxWidgets (Win32, GTK or OS X.) Be sure to read the BUILD and INSTALL instructions if you are wanting to use the sources to build your own copy of wxPython. If you want to build an RPM for your system then please read the begining of the spec file about some options that can be set on the rpmbuild command line. For example, to build a set of RPMs for gtk1, ansi, and python 2.3 you can use this command: rpmbuild -ta --define 'pyver 2.3' \ --define 'port gtk' \ --define 'unicode 0' \ wxPython-src-2.6.4.0.tar.bz2
To get your copy of the source code, simply run these commands, (assumes the command-line version of CVS, if you are using WinCVS or other GUI version, adapt accordingly.) When prompted for a password, type "anoncvs" (the same as the user name.) set CVSROOT=:pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets (or whatever you need to do to set an environment variable in your shell) cvs login cvs co wxWidgets You will find the wxPython sources in the wxWidgets/wxPython directory. When you want to update your copy of the sources, simply change to the wxWidgets directory and run cvs update |