I think many people use Anaconda when they first come into contact with Python. However, there are various theories that Anaconda destroys the environment (see: Python installation method and 3 reasons for not using Anaconda) After all, I think that there are many people who stop using it and switch to Google colab. At that time, I had to switch the active Python version, and the procedure was a little complicated, so I will write it.
[Use the glocal command. ](Switch version with #glocal command) If you don't know the version of Python you're switching to
$ pyenv versions
After confirming the current version and the version you want to switch to
$ pyenv global (Version name to switch to)
is. People who ask, "What is the current version?" Should read it in order.
$ pyenv versions
* system (set by /Users/yuri/.pyenv/version)
3.7.2
anaconda3-4.2.0
anaconda3-5.0.1
The system marked with * is the currently active version.
/Users/yuri/.pyenv/It is said that it is specified by version.
So let's take a look at that file.
#### **`/Users/yuri/.pyenv/version`**
anaconda3-5.0.1
This is it. So, if you delete this file,
$ rm -r /Users/yuri/.pyenv/version $ pyenv versions
It became a system.
If you want to use 3.7.2, just write 3.7.2 in the file above.
## Switch versions with the glocal command
If you know the version you want to switch to, you can use the glocal command to switch instantly.
Let's say you want to switch to 3.7.2.
$ pyenv global 3.7.2 $ pyenv versions system (set by /Users/yuri/.pyenv/version)
It's like this. It became 3.7.2.
## At the end
I'm also an Anaconda user at first, and Python is Anaconda! I thought, but Anaconda seems to have various drawbacks. If I have time, I would like to investigate in detail and write an article next time. Nowadays, there are convenient things such as Google Colab that can be executed on a browser, so unless you need to build an environment locally, I think you should use that.
## reference
I used this as a reference.
[How to use Pyenv](https://qiita.com/mogom625/items/b1b673f530a05ec6b423)
Recommended Posts