Build a python environment with pyenv (OS X El Capitan 10.11.3)

I like Python, but I don't know much because I don't have much time to write. Pyhton3 seems to be interesting soon, so I decided to write it outside of work and prepared an environment.

Python version control

There is a tool called pyenv, so install it with homebrew.

version control


$ brew install pyenv

#Find out which version can be installed
$ pyenv install -l

#Install your favorite version
#It takes time to make cup ramen(Experience)
$ pyenv install 3.5.1
$ pyenv install 3.4.4

$ pyenv versions
* system (set by /Users/cc/.pyenv/version)
  3.4.4
  3.5.1

#If global is specified, that version will be used system-wide.
$ pyenv global 3.4.4

#If you specify local.python_A file called version is created
#Use that version under the directory where this file is located
$ pyenv local 3.4.4

$ pyenv versions
  system
* 3.4.4 (set by /Users/cc/.pyenv/version)
  3.5.1

Other sites have written how to use pyenv-virtualenv, but I don't recommend it because it gets complicated. Assuming virtualenv, it is the system default that is returned by which python.

Create an execution environment for each project

Speaking of Python, it's virtualenv! That's why we create an execution environment with virtualenv.

Execution environment construction


$ pip install virtualenv

$ cd /path/to/develop
$ virtualenv example
$ cd example
$ . bin/activate
(example) $ 

It's too easy. Python is the best!

Bonus (try using PySide)

Let's use PySide, a Python binding for Qt, a multi-platform GUI library.

PySide installation


(example) $ brew install qt

(example) $ cd /path/to/develop/example

#I'm just watching it on YouTube, which is long:)
#PySide is Python 3.It seems that it only supports up to 4(Python3.5 not supported)
(example) $ pip install -U PySide

(example) $ python
Python 3.4.4 (default, Mar  5 2016, 20:17:44)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import PySide
>>> from PySide import QtGui #OK if there is no error so far
>>>

Digression: Which is better, Qt or Electorn?

I looked at various sites, but didn't say which one was better. It's hard to do both, so either one is better ~ The execution speed of Electron was mentioned, but it's a 2015 article. Please let me know if this is good!

Recommended Posts

Build a python environment with pyenv (OS X El Capitan 10.11.3)
Build a Python environment with OSX El capitan
Build an environment with pyenv, pyenv-virtualenv, jupyter on OS X El Capitan
Build a python virtual environment with pyenv
Build a Python development environment on Mac OS X
Build a python data analysis environment on Mac (El Capitan)
Build a Python environment with WSL + Pyenv + Jupyter + VS Code
[Pyenv] Building a python environment with ubuntu 16.04
Build a modern Python environment with Neovim
Build python environment with pyenv on EC2 (ubuntu)
Build a python environment with ansible on centos6
[Python] Build a Django development environment with Docker
[Memo] Build a virtual environment with Pyenv + anaconda
Quickly build a Python Django environment with IntelliJ
Build a Python machine learning environment with a container
Build a python execution environment with VS Code
Build python3 environment with ubuntu 16.04
Build python environment with direnv
Build a Python environment offline
Build a python virtual environment with virtualenv and virtualenvwrapper
Build a machine learning Python environment on Mac OS
Build a Python environment on your Mac using pyenv
Build a machine learning application development environment with Python
Build a Python development environment using pyenv on MacOS
Create a Python development environment on OS X Lion
Build a numerical calculation environment with pyenv and miniconda3
I installed Pygame with Python 3.5.1 in the environment of pyenv on OS X
R environment construction with Jupyter (formerly IPython notebook) (on OS X El Capitan 10.11.3)
Run Qiita API v2 Python wrapper in Python3 environment (Mac OS X 10.11 (El Capitan))
When import tkinter is not possible on Mac OS X 10.11.3 (El Capitan) + pyenv + Python 3.5.1.
Build python virtual environment with virtualenv
Using NAOqi 2.4.2 Python SDK on Mac OS X El Capitan
Build Mysql + Python environment with docker
Create a virtual environment with Python!
Building a virtual environment with Python 3
Build a comfortable development environment with VSCode x Remote Development x Pipenv
Get a clean Python development environment with pyenv + pipx + Poetry
How to build a python2.7 series development environment with Vagrant
Build a python3 environment on CentOS7
I tried to build an environment for machine learning with Python (Mac OS X)
How to rebuild python environment from pyenv on Mac environment (El Capitan)
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
Build a Python execution environment using GPU with GCP Compute engine
Building a Python3 environment with Amazon Linux2
Easily build a development environment with Laragon
Build Jupyter Lab (Python) environment with Docker
Install Python as a Framework with pyenv
Use smbus with python3 under pyenv environment
Install matplotlib on OS X El Capitan
Build a python environment on MacOS (Catallina)
Build a Tensorflow environment with Raspberry Pi [2020]
Building a Python 3.6 environment with Windows + PowerShell
I want to build a Python environment
Build a Fast API environment with docker-compose
Build Python environment with Anaconda on Mac
Build a Python + OpenCV environment on Cloud9
Build AI / machine learning environment with Python
[Linux] Build a Docker environment with Amazon Linux 2
After buying a new Mac, use pyenv + poetry to build a Python environment.
Build a Python + bottle + MySQL environment with Docker on RaspberryPi3! [Easy construction]