Python environment construction For Mac

I'm completely new to python, and I haven't touched it so much, so I'll start by building the environment!

Python version check

Since python is preinstalled on Mac, check first.

$ python --version
Python 2.7.10

$ python3 --version
Python 3.7.7

There is, so preparation is OK!

However, if you do not have it or want to use the latest python, you need to install it separately. Let's install pyenv with homebrew and drop python

Python installation

$ brew install pyenv

Complete after setting environment variables in bash_profile etc.

$ 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

Check the version that can be installed and install the one you need

$ pyenv install --list

Check the available version and run pyenv global to use the installed version (Install 3.8.2 here)

$ pyenv install 3.8.2
$ pyenv versions
$ pyenv global 3.8.2
$ python3 --version

Now you're ready! You can already create something like sample.py and run it with python sample.py!

What a simple environment construction. ..

Recommended Posts

Python environment construction For Mac
Python3 TensorFlow for Mac environment construction
Mac environment construction Python
Python3 environment construction (for beginners)
Ansible environment construction For Mac
Python environment construction
Environment construction (python)
python environment construction
Python --Environment construction
Python environment construction
python environment construction
I checked Mac Python environment construction
Python environment construction memo on Mac
Environment construction of python3.8 on mac
Python project environment construction procedure (for windows)
python windows environment construction
homebrew python environment construction
Creating amateur python environment settings (for MAC)
Anaconda-4.2.0-python3 environment construction (Mac)
Python development environment construction
[Mac] Building a virtual environment for Python
python2.7 development environment construction
Pyxel environment construction (Mac)
Python environment construction @ Win7
Python environment for projects
Python3 TensorFlow environment construction (Mac and pyenv virtualenv)
Python explosive environment construction starting from zero (Mac)
Building an environment for executing Python scripts (for mac)
Python + Anaconda + Pycharm environment construction
Set Up for Mac (Python)
CI environment construction ~ Python edition ~
Anaconda3 python environment construction procedure
Python environment construction and TensorFlow
Python 3 series installation for mac
Python environment construction under Windows7 environment
[MEMO] [Development environment construction] Python
[For organizing] Python development environment
Environment construction of python2 & 3 (OSX)
Summary of python environment settings for myself [mac] [ubuntu]
[Python] Django environment construction (pyenv + pyenv-virtualenv + Anaconda) for macOS
Building a Python environment for programming beginners (Mac OS)
Building a Python environment on Mac
Environment construction of python and opencv
Mac + Eclipse (PyDev) + Django environment construction
Python environment construction memo on Windows 10
Get started with Python! ~ ① Environment construction ~
Anaconda python environment construction on Windows 10
Python + Unity Reinforcement learning environment construction
Anaconda environment construction on Mac (2018 version)
[For beginners] Django -Development environment construction-
Python environment construction (pyenv, anaconda, tensorflow)
[Python3] Development environment construction << Windows edition >>
Python development environment options for May 2020
Python development environment construction on macOS
Python environment construction (pyenv + poetry + pipx)
Emacs settings for Python development environment
Python3 environment construction with pyenv-virtualenv (CentOS 7.3)
Emacs Python development environment construction memo
pytorch @ python3.8 environment construction with pipenv
[docker] python3.5 + numpy + matplotlib environment construction
Python3.6 environment construction (using Win environment Anaconda)