[Python-es] Consulta sobre instalacion wxPython_2.8 en Windows XP.

e-friend_partner fcaxxi en gmail.com
Mar Ago 21 03:46:23 CEST 2012


Buena noche Comunidad !

Soy nuevo en wxPython y Python. Deseo aprender wxPython_2.8 pero leyendo
las notas de instalación ("Building on Windows with Cygwin/MingW32") me
nace un par de dudas sobre los pasos para la correcta instalacion de
wxPython 2.8

- Tengo un Windows XP (32 bit). En él tengo ya instalado CodeBlocks (v.
10.05) el cual viene con Mingw  y Wxwidgets 2.9.3.
- Instale Python 2.7.3 ( python-2.7.3.msi ) y descargue
"wxPython2.8-win32-unicode-2.8.12.1-py27.exe" (aun no he intentado
instalación).

En las notas de "Build" (Archivo adjunto)  que encontre mencionan que debo
primero tener unos paquetes antes de iniciar el proceso de configuracion e
instalación de wxpython.
1. Los paquetes que mencionan son :     autoconf
, automake,  gcc-core,  gcc-g++,   gcc-mingw,    gcc-mingw-core,
gcc-mingw-g++,   make,
    mingw-runtime,      mingw-zlib,       patch  y     w32api.
    Como estoy en ambiente Windows, como los consigo y bajo que carpeta
debo colocarlos, para que la configuracion (..../configure) los tome
correctamente...?

2. En el paso 3 del procedimiento del build adjunto mencionan a wxWidgets,
Si ya lo tengo instalado, es necesario realizar este paso ...?

3. Finalmente, quiero aclarar si es necesario hacer el build o el archivo
que baje ("wxPython2.8-win32-unicode-2.8.12.1-py27.exe") se encargara de
todo esto al ejecutarlo ...?

Gracias por sus aclaraciones.

-- 
Saludos,

Fabio C. A.
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://mail.python.org/pipermail/python-es/attachments/20120820/1abc3047/attachment.html>
------------ próxima parte ------------

Building on Windows with Cygwin/MingW32

Starting with release 2.8.6.1 wxPython is also able to be built for the stock Python on Windows using the cywin environnment and the mingw32 compiler. It can probably also be done with a few modifications to these instructions without cygwin, using just the standalone mingw32 compiler and MSYS, but that has not been tested yet. Another potential option is to build wxWidgets and wxPython for cygwin and the cygwin version of Python, but the details for that also has not yet been worked out. If you do work out the details then please send me patches for this document.

This build has some aspects of both of the builds desctibed above, but leans more towards the Unix-like style of doing things. If you have any questions about the steps detailed in these instructions please read the above sections as well, as the answer could be there.

    If you don't already have cygwin installed on your Windows box please do so know. Make sure you have these additional packages installed as well:

    autoconf
    automake
    gcc-core
    gcc-g++
    gcc-mingw
    gcc-mingw-core
    gcc-mingw-g++
    make
    mingw-runtime
    mingw-zlib
    patch
    w32api

    Create a build directory in the main wxWidgets dir, and configure wxWidgets. Notice that we set some environment variables so configure will know to override the defaults for some compiler and linker flags settings, this is what causes the mingw32 compiler to be used even though we are in the full cygwin environment:

    cd $WXDIR
    mkdir bld
    cd bld

    CC="gcc -mno-cygwin -mwindows"  \
    CXX="g++ -mno-cygwin -mwindows" \
    LDFLAGS="-mno-cygwin -mwindows" \
    ../configure \
        --with-msw \
        --build=i686-pc-mingw32 \
        --prefix=/opt/wx/2.8 \
        --enable-unicode \
        --enable-debug \
        --enable-debug_gdb \
        --enable-geometry \
        --enable-display \
        --enable-shared \
        --with-expat=builtin \
        --with-regex=builtin \
        --with-zlib=builtin

    Read the note above in the unix-like section for why I used /opt/wx/2.8 for the prefix, and for some discussion about what your options are. For a cygwin environment the default of using /usr/local for the prefix would also be a good choice. Note that the wx DLLs will be installed to {prefix}/lib and since DLLs need to be found in the PATH you'll either want to add that dir to your PATH if it isn't already there, or be prepared to move those DLLs someplace else when the build is finished.

    If you don't need to use the debugger you can leave off the --enable-debug and --enable-debug_gdb flags, and add the --enable-optimise flag to cause the compiler to generate more efficient code. I recommend that you also add the --enable-debug_flag flag so that some C++ runtime checks will be turned into Python exceptions when they fail.

    To build and install wxWidgets you could just use the "make" command but there are a couple other libraries besides the main wxWidgets libs that also need to be built so I make a script called ".make" to do it all for me so I don't forget anything. This is what it looks like:

    make $* \
        && make -C contrib/src/gizmos $* \
        && make -C contrib/src/stc $*

    So you just use .make as if it where make:

    .make
    .make install

    This is going to take a while as GCC on Windows is very slow. This would be a good time to go take a nap, or have dinner, or both. When it's done you should have an installed set of files under /opt/wx/2.8 (or whatever prefix you used) containing just wxWidgets. Now to use this version of wxWidgets you just need to add /opt/wx/2.8/bin and /opt/wx/2.8/lib to the PATH.

    Building wxPython is very similar to how it is done for the other build styles. We simply run the setup.py in the wxPython dir, and pass it some commands and flags. Make sure that the Python that you use for running setup.py is the one that you want to use when running wxPython apps. In other words, if you have the cygwin Python installed, or multiple versions of stock Windows Python, then use the full pathname to python.exe to make sure you use the right one.

        python setup.py COMPILER=mingw32

            BUILD_GLCANVAS=0 BUILD_ACTIVEX=0 WX_CONFIG="bash.exe -e /opt/wx/2.8/bin/wx-config" build_ext --inplace

    This builds the wxPython extension modules and places them directly in the wx package dir located in the source tree. This is convenient for testing the build or running the demo and samples without needing to do an install to site-packages and possibly disturbing the wxPython you already have installed. You just need to set PYTHONPATH so Python will find this version of the wx package first. When you are ready to install this build you can do it by adding 'install' to the command line and running it again. See the INSTALL.txt file for more details.

    Notice that we had to turn off the building of the wx.glcanvas and wx.activex modules. There are also a few other features that are not currently supported by this build, most notably the wx.GraphicsContext and wx.media.MediaCtrl families of classes. Hopefully that will improve over time.



Más información sobre la lista de distribución Python-es