LoginSignup
5
5

More than 5 years have passed since last update.

Python3 + Pipenv環境をMacに作る

Last updated at Posted at 2018-10-02

macOSの調子が悪かったので、OSを入れ直した。
ひさしぶりにmacOSにpythonの環境構築をしたので手順をメモしておく。

出来るだけツールの公式が示している手順でインストールを行っていくようにしてある。

環境

  • macOS High Sierra
  • XCode install済み

手順

Homebrewインストール

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

Python3インストール

brewでインストール。

$ brew install python3

バージョンを確認してみる。3.7.0が入った。

$ python3 -V
Python 3.7.0

Pipのインストール

色んなインストール方法があるけど、経験的には、pypaに掲載されているget-pip.pyを使った方法が安定してる気がする。

$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python3 get-pip.py

入った。


$ pip -V
pip 18.0 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

Pipenvのインストール

brewで入る。

$ brew install pipenv
$ pipenv --version
pipenv, version 2018.7.1

確認

$ pipenv install --python 3.7 pandas
$ pipenv shell
$ python -c "import pandas; print(pandas.__version__)"
0.23.4

できた。

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5