Come garantire percorsi separati per ogni istanza di Python

2

Recentemente ho aggiornato a High Sierra sul mio Macbook Air. Ho installato l'ultimo aggiornamento di Python: 2.7.14 da python.org. C'è una documentazione e un file Leggimi per 2.7.14 nella cartella Applicazioni. Il file Leggimi per gli stati python installati dall'utente:

As of Python 2.7.0, user-installed Python 2.7 versions from python.org installers added the system-wide site-packages directory for the Apple-supplied Python 2.7 to the end of their search path. This meant that packages installed with the system Python 2.7 could also be used by the user-installed Python 2.7. While sometimes convenient, this also often caused confusion with the implicit coupling between the two Python instances. Separately, as of macOS 10.12, Apple changed the layout of the system site-packages directory, /Library/Python/2.7/site-packages, in a way that can now cause installation of pip components to fail. To avoid the confusion and the installation failures, as of 2.7.13 user-installed pythons no longer add /Library/Python/2.7/site-packages to sys.path. If you are using a package with both a user-installed Python 2.7 and the system Python 2.7, you will now need to ensure that separate copies of the package are installed for each instance.

Non comprendo completamente il significato di questo. Voglio essere sicuro di aver impostato tutto correttamente prima di procedere. C'è un comando che posso digitare nel mio terminale che punterà al pathway di Python 2.7.14 che ho appena installato? Voglio essere sicuro che ci siano percorsi separati per ogni istanza di Python.

    
posta Bergi 30.01.2018 - 11:05
fonte

1 risposta

1

Dovresti configurare ambienti virtuali in modo che ciascuna versione di Python sia indipendente dalle altre. Impostarli è abbastanza semplice e puoi trovare le istruzioni su Internet qui e qui così come molti altri posti. Corro ambienti virtuali e questo mi permette di eseguire 2.7.13 o 3.6 senza problemi. Mi basta attivare l'ambiente che desidero e quindi avviare l'esecuzione di quella versione di python.

    
risposta data 30.01.2018 - 22:33
fonte

Leggi altre domande sui tag