Come posso scoprire quali versioni di Python ho?
Sto usando Ubuntu 14.04 (Trusty Tahr).
Digitate quanto segue nel terminale (Ctrl+Alt+T):
python -V
oppure
python --version
Potete trovare una lista di opzioni/parametri per molti comandi nel terminale digitando il comando seguito da --help
Esempio:
python --help
Sono disponibili anche manuali/manuali per la maggior parte di tali CLI che possono essere visualizzati da man <command>
(Es: man python
)
Da man python
:
COMMAND LINE OPTIONS
-V , --version
Prints the Python version number of the executable and exits.
C'è anche python3
installato su molte macchine, quindi si può fare:
python3 --version
per scoprire quale python 3.x stai usando.
Quando si esegue python
nel terminale, produrrà un output come questo:
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Vedere la prima linea - Python 2.7.6
.
Esegui anche python3
. Ho la 3.4.1
Python 3.4.1 (default, Jul 31 2014, 12:46:17)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Tuttavia, questo non te le mostrerà tutte. Se hai 2 o più versioni di python 3.X.x, vedrai solo l'ultima.
Per default su 14.04, avete la 2.7.6 e la 3.4.0. Come potete vedere, ho aggiornato alla 3.4.1. So che ho ancora la 3.4.0 perché quando vado in /usr/bin
vedo python3.4
, e se eseguo /usr/bin/python3.4
nella linea di comando, ottengo la 3.4.0, ed eseguendo /usr/local/bin/python3.4
mi dà la 3.4.1
I miei pronomi sono Lui / Lui