Python - Versión de python en Mac

 
Vista:

Versión de python en Mac

Publicado por angel moreno (2 intervenciones) el 23/01/2012 20:32:38
Hola,

¿Cómo se selecciona la versión por defecto de python en Mac?
Viene por defecto la versión 2.5 (Snow Leopard) pero tengo instaladas otras. Ahora quiero que, por defecto, abra la 2.7. ¿Cómo se especifica?

A
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de xve
Val: 2.239
Plata
Ha mantenido su posición en Python (en relación al último mes)
Gráfica de Python

Versión de python en Mac

Publicado por xve (1646 intervenciones) el 23/01/2012 23:29:34
Hola Angel, te voy a comentar como se hace en Linux, y espero que te sirva para Mac...

Desde un terminal y como root....
1
2
3
4
5
6
7
8
9
# cd /usr/bin/
# ls -l python*
lrwxrwxrwx 1 root root       9 Oct  9 14:49 python -> python2.7
-rwxr-xr-x 1 root root 2634416 Aug  3 14:37 python2.6
-rwxr-xr-x 1 root root 2744088 Dec  1 01:41 python2.7
-rwxr-xr-x 1 root root 6303972 Dec  1 00:19 python2.7-dbg
-rwxr-xr-x 1 root root    1656 Dec  1 01:41 python2.7-dbg-config
lrwxrwxrwx 1 root root      13 Oct  9 14:49 python-dbg -> python2.7-dbg
lrwxrwxrwx 1 root root      20 Oct  9 14:49 python-dbg-config -> python2.7-dbg-config

Como puedes ver, en mi maquina cuando ejecuto python, estoy ejecutando la version 2.7, ya que python es un enlace simbolico hacia python2.7

Para cambiar de versión, puedes hacerlo así:
1
2
3
4
5
6
7
8
9
10
11
# cd /usr/bin/
# rm python
# ln -s python2.6 python
# ls -l python*
lrwxrwxrwx 1 root root       9 Oct  9 14:49 python -> python2.6
-rwxr-xr-x 1 root root 2634416 Aug  3 14:37 python2.6
-rwxr-xr-x 1 root root 2744088 Dec  1 01:41 python2.7
-rwxr-xr-x 1 root root 6303972 Dec  1 00:19 python2.7-dbg
-rwxr-xr-x 1 root root    1656 Dec  1 01:41 python2.7-dbg-config
lrwxrwxrwx 1 root root      13 Oct  9 14:49 python-dbg -> python2.7-dbg
lrwxrwxrwx 1 root root      20 Oct  9 14:49 python-dbg-config -> python2.7-dbg-config

Ahora estoy utilizando la versión 2.6

Espero que te sirva para mac... coméntanos, ok?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Versión de python en Mac

Publicado por Angel Moreno (2 intervenciones) el 24/01/2012 00:00:35
Solucionado.

En mac la ruta del link es distinta (poner # which python). Una vez ahí, los comandos son los que has dicho, xve.

Gracias,
A
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar