[PYTHON] Comment utiliser Pyenv

Qu'est-ce que Pyenv?

--Facile à basculer entre plusieurs versions de Python.

Localisation de Pyenv

pyenv/pyenv

Cet environnement de travail

Installation

Essayez d'installer avec pyenv-installer.

$ curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash

Ecrire les paramètres dans .bashrc

$ echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(pyenv init -)"' >> ~/.bashrc
$ echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
$ source ~/.bashrc
$ pyenv -v
pyenv 1.0.10-2-geef042a

Commandes Pyenv

$ pyenv install --list
$ apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils
$ pyenv install 3.6.1
$ pyenv install anaconda3-4.3.1
$ pyenv versions
* system (set by /root/.pyenv/version)
  3.6.1
  anaconda3-4.3.1

Essayez de changer de version

Vérifier la version actuelle

$ python --version
Python 2.7.12

Utilisez la commande globale pour changer de version.

$ pyenv global 3.6.1
$ pyenv versions
  system
* 3.6.1 (set by /root/.pyenv/version)
  anaconda3-4.3.1
$ python --version
Python 3.6.1

Changez de version à l'aide de la commande locale.

$ cd hoge
$ pyenv local anaconda3-4.3.1
$ python --version
Python 3.6.0 :: Anaconda 4.3.1 (64-bit)
$ cd ..
$ python --version
Python 3.6.1

Au fait, quand j'ai regardé le contenu de .python-version, seul le nom de la version était écrit.

$ cat .python-version
anaconda3-4.3.1

Vérifiez l'emplacement de Python (chemin complet)

$ pyenv which python3.6
/root/.pyenv/versions/3.6.1/bin/python3.6

Au fait, j'essaye aussi l'ordinaire qui.

$ which python3.6
/root/.pyenv/shims/python3.6
$ which python
/root/.pyenv/shims/python

Recommended Posts

Comment utiliser Pyenv
Comment utiliser xml.etree.ElementTree
Comment utiliser Python-shell
Remarques sur l'utilisation de tf.data
Comment utiliser virtualenv
Comment utiliser Seaboan
Comment utiliser la correspondance d'image
Comment utiliser le shogun
Comment utiliser Pandas 2
Comment utiliser Virtualenv
Comment utiliser numpy.vectorize
Comment utiliser partiel
Comment utiliser Bio.Phylo
Comment utiliser SymPy
Comment utiliser WikiExtractor.py
Comment utiliser IPython
Comment utiliser virtualenv
Comment utiliser Matplotlib
Comment utiliser iptables
Comment utiliser numpy
Comment utiliser TokyoTechFes2015
Comment utiliser venv
Comment utiliser le dictionnaire {}
Comment utiliser la liste []
Comment utiliser python-kabusapi
Comment utiliser OptParse
Comment utiliser le retour
Comment utiliser pyenv-virtualenv
Comment utiliser imutils
Comment utiliser Qt Designer
[gensim] Comment utiliser Doc2Vec
python3: Comment utiliser la bouteille (2)
Comprendre comment utiliser django-filter
Comment utiliser le générateur
[Python] Comment utiliser la liste 1
Comment utiliser FastAPI ③ OpenAPI
Comment débloquer Pyenv Global
Comment utiliser Python Argparse
Comment désinstaller pyenv lui-même
Comment utiliser IPython Notebook
[Note] Comment utiliser virtualenv
Comment utiliser les dictionnaires redis-py
Python: comment utiliser pydub
[Python] Comment utiliser checkio
[Aller] Comment utiliser "... (3 périodes)"
Comment utiliser tkinter avec python dans pyenv
Comment faire fonctionner GeoIp2 de Django
Comment utiliser Ruby's PyCall pour activer Pyenv Python
[Python] Comment utiliser input ()
Comment utiliser le décorateur
[Introduction] Comment utiliser open3d
Comment utiliser Python lambda
Comment utiliser Jupyter Notebook
[Python] Comment utiliser virtualenv
python3: Comment utiliser la bouteille (3)
python3: Comment utiliser la bouteille
Comment utiliser Google Colaboratory
Comment utiliser les octets Python