mac OS Catalina Version 10.15.7 I have Xcode installed (Version 12.1), but it hasn't been open all the time
$ python --version
Check the current version with → 2.7. What should I do?
$ brew update
$ brew install pyenv
Install pyenv with homebrew
$ pyenv install 3.6.5
Here, the first error
error contents
>zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
Because it came out
```$ brew install zlib```
However, there is no particular change.
https://qiita.com/miyacomaru/items/a105800f938de7b908e0
With reference to
```$ xcode-select --install```
I did,
> This software is currently not available from the software update server and cannot be installed.
Will be alerted.
https://qiita.com/kuzira_vimmer/items/6b017896f9b44ae9f5c3
I solved it by manually installing Command Line Tools from the page below with reference to this. (Dev account required? Is it OK to log in with an Apple ID? I had a Dev account, so I don't know which one)
https://developer.apple.com/download/more/
# I was able to install it! Next, "set to always use 3 series (3.6.5 in my case)"
First, check the version
```$ pyenv versions```
Confirm that pyenv is 3.6.5
```$ python --version```
Then, 2.7.
## init pyenv
```$ pyenv init```
Then
```# load pyenv automatically by appending```
#### **`python`**
```# the following to ~/.bash_profile
```eval "$(pyenv init -)"```
Will come out, so
#### **`$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile`**
And it's done!
Finally
$ python --version
If you try, it should be 3 series.
Recommended Posts