Build a Python environment on Mac (Mountain Lion)

There were many articles that used pythonz to install Python, but [here](http://kesin.hatenablog.com/entry/2013/07/22/%E7%B5%90%E5%B1%80Python% E3% 81% AFvirtualenv% E3% 81% A7% E7% AE% A1% E7% 90% 86% E3% 81% 97% E3% 81% A6% E3% 81% BF% E3% 82% 8B% E3% 81% 93% E3% 81% A8% E3% 81% AB% E3% 81% 97% E3% 81% 9F "Kesin's diary programming article is the main article. Python rate is high") to install Python Is done with homebrew.

Python installation

#Install 2 series python
% brew install python

#Install 3 series python
% brew install python3

Installation of virtualenv and virtualenvwrapper

See this area for virtualenv and virtualenvwrappe.

% pip install virtualenv virtualenvwrapper

virtualenv and virtualenv wrapper settings

Add the following to .zshrc

.zshrc


#Specify python used by virtualenvwrapper
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
#Even if you installed pip globally,Install the package in the virtualenv environment.
export PIP_RESPECT_VIRTUALENV=true
source "/usr/local/bin/virtualenvwrapper.sh"

Creating a virtual environment

#Create an environment called py2 that uses python2 series
% mkvirtualenv py2 --python /usr/local/bin/python2

#Create an environment called py3 that uses python3 series
% mkvirtualenv py3 --python /usr/local/bin/python3

#Check the created virtual environment
% lsvirtualenv
py2
===


py3
===


(py3)

virtualenvwrapper command

virtualenvwrapper 3.5 --command reference

reference

・ [Kesin's diary The main article is programming. Python rate is high-I decided to manage Python with virtualenv](http://kesin.hatenablog.com/entry/2013/07/22/%E7%B5%90%E5%B1%80Python% E3% 81% AFvirtualenv% E3% 81% A7% E7% AE% A1% E7% 90% 86% E3% 81% 97% E3% 81% A6% E3% 81% BF% E3% 82% 8B% E3% 81% 93% E3% 81% A8% E3% 81% AB% E3% 81% 97% E3% 81% 9F "Kesin's diary programming articles are the main. Python rate is high") -About Python today --VIRTUALENV ・ [Kanonji's blog-Note on building Python environment with pythonz, virtualenv and virtualenvwrapper](http://kanonji.info/blog/2013/07/11/pythonz%E3%81%A8virtualenv%E3%81%A8virtualenvwrapper%E3 % 81% A7python% E7% 92% B0% E5% A2% 83% E6% A7% 8B% E7% AF% 89% E3% 81% AE% E3% 83% A1% E3% 83% A2 / Python --About VIRTUALENV ")

Recommended Posts

Build a Python environment on Mac (Mountain Lion)
Build a Python development environment on your Mac
Create a Python environment on Mac (2017/4)
Build a python3 environment on CentOS7
Build a machine learning Python environment on Mac OS
Build a Python development environment on Mac OS X
Build a Python environment on your Mac using pyenv
Create a python environment on your Mac
Build a python data analysis environment on Mac (El Capitan)
Build Python environment with Anaconda on Mac
Build a Python + OpenCV environment on Cloud9
Simply build a Python 3 execution environment on Windows
Build a python environment with ansible on centos6
Build a Python development environment on Raspberry Pi
Build Python environment on Windows
Build python environment on windows
Build a Python environment offline
Build a GVim-based Python development environment on Windows 10 (3) GVim8.0 & Python3.6
Install Python3 on Mac and build environment [Definitive Edition]
Build a Django development environment using pyenv-virtualenv on Mac
Build a local development environment for Laravel6.X on Mac
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 using pyenv on MacOS
How to build a Python environment on amazon linux 2
Create a Python development environment on OS X Lion
Building a Python environment on Ubuntu
Python environment construction memo on Mac
Create a python environment on centos
Environment construction of python3.8 on mac
Build Python 3.8 + Pipenv environment on Ubuntu 18.04
Build a python machine learning study environment on macOS sierra
Build a machine learning environment on mac (pyenv, deeplearning, opencv)
Create a Python (pyenv / virtualenv) development environment on Mac (Homebrew)
How to build a new python virtual environment on Ubuntu
Build a GVim-based Python development environment on Windows 10 (2) Basic settings
Build a Python extension for E-Cell 4 on Mac OSX (Yosemite)
Create a virtual environment for python on mac [Very easy]
Build a python environment on CentOS 7.7 for your home server
How to build a beautiful Python environment on a new Mac and install Jupter Notebook
python on mac
Python 2.7, 3.4, 3.5 extension module build environment on Windows
I want to build a Python environment
[Mac] Building a virtual environment for Python
Creating a python virtual environment on Windows
I installed Kivy on a Mac environment
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
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
Build a LAMP environment on your local Docker
Things to watch out for when creating a Python environment on a Mac
Build a WardPress environment on AWS with pulumi
After buying a new Mac, use pyenv + poetry to build a Python environment.
Build python environment with pyenv on EC2 (ubuntu)
Build Python3.5 + matplotlib environment on Ubuntu 12 using Anaconda
Build a Python + bottle + MySQL environment with Docker on RaspberryPi3! [Easy construction]
Build a Django environment on Raspberry Pi (MySQL)
Install Python on Mac
Install Python 3 on Mac
[Python] Build a Django development environment with Docker