Problemas con la versión de wxPython al intentar iniciar SPE
Este post fue migrado de un blog hecho con Wordpress. Si se ve mal, dejame un comentario y lo arreglo.
apt-get install spe
Cuando intenté ejecutarlo, hubo un problema:
juanjo@sarge:~$ spe
You need to install at least wxPython v2.5.4.1 to run SPE.
Get it from http://www.wxpython.org
Pero mi versión instalada de wxPython era la 2.6.x.. en el resto del artículo: 2 formas de solucionar el problema.
Además de saber que el paquete que tenía instalado era wxpython2.6 y no wxpython2.4 (que también era un candidato), comprobé la versión que tenía instalada desde el intérprete interactivo de Python:
>>> import wxPython >>> dir(wxPython) ['__builtins__', '__doc__', '__file__', '__name__', '__path__', '__version__', '_controls', '_core', '_gdi', '_misc', '_windows', '_wx', 'wx'] >>> wxPython.__version__ '2.6.3.2'
Entré al canal #python
de irc.freenode.org
donde alguien me dijo que en las versiones viejas de SPE había un bug con el chequeo de versiones y me me convenía instalar manualmente la última versión.
svn checkout svn://svn.berlios.de/python/spe/trunk/_spe
python _spe/SPE.py
me daba el mismo error.
Cundo revisé el código de _spe/SPE.py
, estas eran las primeas líneas:
import sys try: WX_VERSION = '2.5.4.1' import wxversion wxversion.ensureMinimal(WX_VERSION) except ImportError: print 'You need to install at least wxPython v%s to run SPE.\nGet it from http://www.wxpython.org'%WX_VERSION sys.exit()
Solución 1
Probé importar wxversion
desde un interprete de Python, no tenía el módulo y eso producía una excepción, lo que producía que se muestre ese error y se termine el programa. Comentando las líneas:
#import wxversion #wxversion.ensureMinimal(WX_VERSION)
pude correr el programa sin problemas.
Solución 2
En realidad el problema es que el módulo wxversion
no está instalado. En un momento había pasado por la página de wxPython y entre sus nuevas features había leido:
..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.
El módulo wxversion
sirve para hacer la selección de versión de wxPython. Por lo que la otra solución es instalar este módulo:
apt-get install python-wxversion
Comentarios
Comments powered by Disqus