In diesem Artikel möchte ich eine Reihe von Abläufen von der Deinstallation bis zur Installation schreiben, wenn ein Problem in Anaconda usw. auftritt.
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.2
BuildVersion:   19C57
Führen Sie die folgenden Schritte aus, um die Deinstallation durchzuführen
--installiere pyenv-virtualenv
$ brew uninstall pyenv-virtualenv
Uninstalling /usr/local/Cellar/pyenv-virtualenv/1.1.3... (20 files, 62.2KB)
pyenv$ brew uninstall pyenv
Uninstalling /usr/local/Cellar/pyenv/1.2.14_1... (656 files, 2.4MB)
$ rm -rf $(pyenv root)
Dies ist dasselbe wie "$ rm -rf ~ / .pyenv"
Installieren Sie pyenv mit dem folgenden Befehl
$ brew install pyenv
.bash_profileFühren Sie den folgenden Befehl aus
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile
$ pyenv install --list
Available versions:
  2.1.3
  2.2.3
  2.3.7
  2.4.0
  ...
(Kürzung)
  ...
  3.0.1
  3.1.0
  3.1.1
  3.1.2
  ...
(Kürzung)
  ...  
  3.6.8
  3.6.9
  3.7.0
  3.7-dev
  3.7.1
  3.7.2
  3.7.3
  3.7.4
  3.7.5
  3.7.5rc1
  3.8.0
  3.8-dev
  3.9-dev
  activepython-2.7.14
  activepython-3.5.4
  activepython-3.6.0
  anaconda-1.4.0
  anaconda-1.5.0
  anaconda-1.5.1
  anaconda-1.6.0
  anaconda-1.6.1
  anaconda-1.7.0
  ...
(Kürzung)
  ... 
  anaconda3-5.1.0
  anaconda3-5.2.0
  anaconda3-5.3.0
  anaconda3-5.3.1
  anaconda3-2018.12
  anaconda3-2019.03
  anaconda3-2019.07
  anaconda3-2019.10
  ...
(Kürzung)
  ... 
$ pyenv install anaconda3-2019.10
Wenn Sie normales Python möchten, können Sie so etwas wie "$ pyenv install 3.7.5" ausführen
$ pyenv versions
$ python --version
Python 2.7.15
--Überprüfen Sie die verfügbare Python-Version
$ pyenv versions
  system
* anaconda3-2019.10 (set by /Users/******/.pyenv/version)
$ pyenv global anaconda3-2019.10
--Überprüfen Sie die Version von Python, die Sie verwenden --OK wenn es auf die angegebene Version eingestellt ist
$ python --version
Python 3.7.4
--Wenn die neu installierte Version "anaconda3-2019.10" ist, bleibt die frühere Version wie folgt.
$ cd ~/.pyenv/versions/
$ ls
anaconda3-2019.10/ anaconda3-5.3.1/
anaconda3-5.3.1 verwendet haben, führen Sie den folgenden Befehl aus.rm ausführen, kann er nicht mit Autorität gelöscht werden. Führen Sie ihn daher mit sudo aus.$ sudo rm -rf ~/.pyenv/versions/anaconda3-5.3.1/
$ vim /etc/paths
/ etc / path sieht so aus. Die Priorität wird von oben angegeben. 1 /usr/local/bin
 2 /usr/bin
 3 /bin
 4 /usr/local/sbin
 5 /usr/sbin
 6 /sbin
das ist alles
Recommended Posts