Build python3.x with pyenv

What is pyenv

A tool that allows you to easily switch between multiple Python versions

Environment construction procedure

  1. Install Homebrew
  2. pyenv installation
  3. Pass the path of pyenv
  4. Install python3.6
  5. Apply python3.6

1. Install Homebrew

Homebrew is a package manager for macOS, and it is necessary to install pyenv, so install it. If you use Homebrew, you can put php, mysql, etc. in addition to pyenv. Homebrew official page: https://brew.sh/index_ja

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. pyenv installation

pyenv is a python version control tool.

brew install pyenv

3. Pass the path of pyenv

Edit bash_profile to pass the path. You can add the path by executing all the commands below.

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

4. Install python3.6

To install the python version with pyenv, run pyenv install version to install. Since 3.6 will be installed this time, execute the following command.

pyenv install 3.6.0

5. Apply python3.6

pyenv global 3.6.0

reference

Installing and using pyenv, what to do when you cannot switch the python version

How to use Pyenv

Recommended Posts

Build python3.x with pyenv
Install python2.x on catalina with pyenv
Build a python virtual environment with pyenv
Build a virtual environment with pyenv and venv
Install python with pyenv
Build a numerical calculation environment with pyenv and miniconda3
When pyenv install BUILD FAILED
Build python3 environment with ubuntu 16.04
Build python environment with direnv
Reinstall python with pyenv with -fPIC
Easily build CNN with Keras
python with pyenv and venv
Let's build git-cat with Python
Build a python environment with pyenv (OS X El Capitan 10.11.3)
Build a Python environment with WSL + Pyenv + Jupyter + VS Code
Build FastAPI + uvicorn + nginx with docker-compose
How to deal with python installation error in pyenv (BUILD FAILED)
Do not switch with pyenv global!
Build python virtual environment with virtualenv
Build a deb file with Docker
Set python compile options with pyenv
Build Mysql + Python environment with docker
Easily switch pyenv virtualenvs with peco
[AWS] Build an ECR with AWS CDK
Build Flask environment with Dockerfile + docker-compose.yml
Build PyPy execution environment with Docker
Build mlpy with python3.3 (64bit) (windows 64bit)
Unable to install Python with pyenv
Use Python in pyenv with NeoVim
Build a web application with Django
Build IPython Notebook environment with boot2docker
Automatically build Python documentation with Sphinx
Easily build virtual machines with Vagrant
Build Vim with MinGW. (+ lua, + python)
Wget fails during install with pyenv
How to install Anaconda with pyenv
Environment construction with pyenv and pyenv-virtualenv
Use pydoc with Virtualenv / pyenv / venv
Build an environment with pyenv, pyenv-virtualenv, jupyter on OS X El Capitan
[Pyenv] Building a python environment with ubuntu 16.04
[Ubuntu 18.04] Python environment construction with pyenv + pipenv
Build Jupyter Lab (Python) environment with Docker
Use smbus with python3 under pyenv environment
Build a blockchain with Python ① Create a class
Build a Tensorflow environment with Raspberry Pi [2020]
Build a Fast API environment with docker-compose
Build Python environment with Anaconda on Mac
[Linux] Build a jenkins environment with Docker
Use Anaconda-Python installed with pyenv from openFrameworks
Build a capture acquisition machine with Selenium
Build a modern Python environment with Neovim
Build static library (.a) together with waf
Build AI / machine learning environment with Python
Build CentOS 8 on ESXi 6.7 with minimal configuration
CentOS 7: Enable pyenv with Apache (httpd) CGI
Build NGINX + NGINX Unit + MySQL environment with Docker
[Linux] Build a Docker environment with Amazon Linux 2