Build a python environment on MacOS (Catallina)

When I thought that I would start programming on my first Mac, I immediately got stuck in building an environment, so as a memo

environment

Cause of clogging

Mostly because of zsh: rage: Since the standard shell has changed from bash to zsh from Catallina, there is a problem that the path does not pass when following the article searched in Tekito. If there is a difference in the shell configuration file name and you refer to the article using bash

Need to replace

python environment construction

Mac has an old version of python (2 series) as standard 2 series is different from the latest version python (3 series), so it is better to switch This time, switch the python version with a tool called pyenv.

Install pyenv

Execute the following command in the shell If brew is not installed, install brew first

brew install pyenv

After installation, post the following to .zshrc to pass the path Create if .zshrc does not exist

.zshrc


export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi
~ 

Execute the following command to save and reload .zshrc

source ~/.zshrc

This completes the installation, run pyenv --version and make sure it is in your path

Install python with pyenv

Run the following command to see a list of python versions that can be installed with pyenv

pyenv install --list

Select the version you want to use from there and install Select 3.8.0 this time

pyenv install 3.8.0

After installation, switch the standard python with the following command The second is a command that applies switching only to the current directory

pyenv python global 3.8.0
pyenv python local 3.8.0

After switching, check the python version with python --version Success if changed to any version

Reference link

-Installing and using pyenv, what to do if you can't switch python versions

Recommended Posts

Build a python environment on MacOS (Catallina)
Build a python3 environment on CentOS7
Build a Python development environment using pyenv on MacOS
Build a Python + OpenCV environment on Cloud9
Build a python machine learning study environment on macOS sierra
Simply build a Python 3 execution environment on Windows
Build a python environment with ansible on centos6
Build a Python environment on Mac (Mountain Lion)
Build Python environment on Windows
Build a Python development environment on your Mac
Build python environment on windows
Build a Python environment offline
Build a Python development environment on Raspberry Pi
Build a GVim-based Python development environment on Windows 10 (3) GVim8.0 & Python3.6
Build a machine learning Python environment on Mac OS
Notes on creating a python development environment on macOS Catalina
Build a GVim-based Python development environment on Windows 10 (1) Installation
How to build a Django (python) environment on docker
Build a Python development environment on Mac OS X
Build a Python environment on your Mac using pyenv
How to build a Python environment on amazon linux 2
Building a Python environment on Ubuntu
Create a Python environment on Mac (2017/4)
Python development environment construction on macOS
Create a python environment on centos
Build Python 3.8 + Pipenv environment on Ubuntu 18.04
How to build a new python virtual environment on Ubuntu
Build a python data analysis environment on Mac (El Capitan)
Build a GVim-based Python development environment on Windows 10 (2) Basic settings
Build a python environment on CentOS 7.7 for your home server
Python 2.7, 3.4, 3.5 extension module build environment on Windows
Create a python environment on your Mac
I want to build a Python environment
Creating a python virtual environment on Windows
Build Python environment with Anaconda on Mac
Build a python virtual environment with pyenv
Build a modern Python environment with Neovim
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
Build a Python environment on your Mac with Anaconda and PyCharm
# 3 Build a Python (Django) environment on AWS EC2 instance (ubuntu18.04) part2
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
build Python on Ubuntu
Create a Python environment
Build a LAMP environment on your local Docker
Build a WardPress environment on AWS with pulumi
Build python environment with pyenv on EC2 (ubuntu)
Build Python3.5 + matplotlib environment on Ubuntu 12 using Anaconda
Build a Django environment on Raspberry Pi (MySQL)
[Python] Build a Django development environment with Docker
Create a python3 build environment with Sublime Text3
Build a simple Python virtual environment without pyenv
[Venv] Create a python virtual environment on Ubuntu
Build Python3 + flask environment on GCP Compute Engine
Build a Kubernetes environment for development on Ubuntu
Set up a Python development environment on Marvericks
Build a Python environment with OSX El capitan
Quickly build a Python Django environment with IntelliJ
Building a Python environment on a Sakura VPS server
Create a Python execution environment on IBM i
Create a Python virtual development environment on Windows
Build a Python machine learning environment with a container