Python 3 のパッケージマネージャである pip3 を使ってみた。
初期状態
Python 3 のインストール直後。
$ pip3 list Package Version ---------- ------- pip 18.1 setuptools 40.6.3 wheel 0.32.3 $
色々入れてみる
パッケージをいくつか入れてみる。これには pip3 install
を使う。複数のパッケージを指定することもできる。
$ pip3 install numpy scipy matplotlib pandas scikit-learn Collecting numpy Downloading https://files.pythonhosted.org/packages/83/0d/1dd2f96eff7f5df22166066f7dbd213428d46f78f8ed9dea8345ca1a1f51/numpy-1.16.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (13.9MB) 100% |████████████████████████████████| 13.9MB 2.2MB/s Collecting scipy Downloading https://files.pythonhosted.org/packages/c2/7b/370891c7686e598c59890588722c1d1c2b485953c4b127b7b752accbddb6/scipy-1.2.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (28.7MB) 100% |████████████████████████████████| 28.7MB 839kB/s Collecting matplotlib Downloading https://files.pythonhosted.org/packages/50/08/2cdc493a19805d40f77db9674ae8100b37feafeef12686cb30dab19c8192/matplotlib-3.0.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (14.1MB) 100% |████████████████████████████████| 14.1MB 1.7MB/s Collecting pandas Downloading https://files.pythonhosted.org/packages/6b/dc/3a88b7bf8437f3f052fc90de72f28c06248142821a7f108e10ff3be5eb59/pandas-0.23.4-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (14.4MB) 100% |████████████████████████████████| 14.4MB 2.1MB/s Collecting scikit-learn Downloading https://files.pythonhosted.org/packages/11/0f/e2279fee7f9834c63b24fe64515412fd21dd81e82adcf6c79dcc93bb8e6a/scikit_learn-0.20.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (7.8MB) 100% |████████████████████████████████| 7.8MB 3.3MB/s Collecting python-dateutil>=2.1 (from matplotlib) Downloading https://files.pythonhosted.org/packages/74/68/d87d9b36af36f44254a8d512cbfc48369103a3b9e474be9bdfe536abfc45/python_dateutil-2.7.5-py2.py3-none-any.whl (225kB) 100% |████████████████████████████████| 235kB 11.7MB/s Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib) Downloading https://files.pythonhosted.org/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl (61kB) 100% |████████████████████████████████| 71kB 13.8MB/s Collecting cycler>=0.10 (from matplotlib) Downloading https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl Collecting kiwisolver>=1.0.1 (from matplotlib) Downloading https://files.pythonhosted.org/packages/68/f2/21ec13269a420c063a3d7d8c87dac030da7b00fc6b27fa88cfb1c72a645b/kiwisolver-1.0.1-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (107kB) 100% |████████████████████████████████| 112kB 9.4MB/s Collecting pytz>=2011k (from pandas) Downloading https://files.pythonhosted.org/packages/61/28/1d3920e4d1d50b19bc5d24398a7cd85cc7b9a75a490570d5a30c57622d34/pytz-2018.9-py2.py3-none-any.whl (510kB) 100% |████████████████████████████████| 512kB 10.1MB/s Collecting six>=1.5 (from python-dateutil>=2.1->matplotlib) Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl Requirement already satisfied: setuptools in /usr/local/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib) (40.6.3) Installing collected packages: numpy, scipy, six, python-dateutil, pyparsing, cycler, kiwisolver, matplotlib, pytz, pandas, scikit-learn Successfully installed cycler-0.10.0 kiwisolver-1.0.1 matplotlib-3.0.2 numpy-1.16.0 pandas-0.23.4 pyparsing-2.3.1 python-dateutil-2.7.5 pytz-2018.9 scikit-learn-0.20.2 scipy-1.2.0 six-1.12.0 $
期待どおり、依存も解決してくれている。再度 pip3 list
してみると、だいぶ賑やかになったことがわかる。
$ pip3 list Package Version --------------- ------- cycler 0.10.0 kiwisolver 1.0.1 matplotlib 3.0.2 numpy 1.16.0 pandas 0.23.4 pip 18.1 pyparsing 2.3.1 python-dateutil 2.7.5 pytz 2018.9 scikit-learn 0.20.2 scipy 1.2.0 setuptools 40.6.3 six 1.12.0 wheel 0.32.3 $
pylint を入れる
Python 用のコードチェックツールである pylint は、Mac で使う場合は pip/pip3 でインストールするらしい。
$ pip3 install pylint Collecting pylint Downloading https://files.pythonhosted.org/packages/a5/06/ecef826f319055e6b231716730d7f9047dd7524ffda224b521d989f085b6/pylint-2.2.2-py3-none-any.whl (750kB) 100% |████████████████████████████████| 757kB 7.5MB/s Collecting mccabe (from pylint) Downloading https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl Collecting astroid>=2.0.0 (from pylint) Downloading https://files.pythonhosted.org/packages/fc/53/8809bc008bad0300897281a7b320b286dc0e84e836396c0cff6279841e8a/astroid-2.1.0-py3-none-any.whl (176kB) 100% |████████████████████████████████| 184kB 11.1MB/s Collecting isort>=4.2.5 (from pylint) Downloading https://files.pythonhosted.org/packages/1f/2c/22eee714d7199ae0464beda6ad5fedec8fee6a2f7ffd1e8f1840928fe318/isort-4.3.4-py3-none-any.whl (45kB) 100% |████████████████████████████████| 51kB 11.4MB/s Collecting wrapt (from astroid>=2.0.0->pylint) Downloading https://files.pythonhosted.org/packages/67/b2/0f71ca90b0ade7fad27e3d20327c996c6252a2ffe88f50a95bba7434eda9/wrapt-1.11.1.tar.gz Requirement already satisfied: six in /usr/local/lib/python3.7/site-packages (from astroid>=2.0.0->pylint) (1.12.0) Collecting lazy-object-proxy (from astroid>=2.0.0->pylint) Downloading https://files.pythonhosted.org/packages/55/08/23c0753599bdec1aec273e322f277c4e875150325f565017f6280549f554/lazy-object-proxy-1.3.1.tar.gz Building wheels for collected packages: wrapt, lazy-object-proxy Running setup.py bdist_wheel for wrapt ... done Stored in directory: /Users/sardine/Library/Caches/pip/wheels/89/67/41/63cbf0f6ac0a6156588b9587be4db5565f8c6d8ccef98202fc Running setup.py bdist_wheel for lazy-object-proxy ... done Stored in directory: /Users/sardine/Library/Caches/pip/wheels/a0/63/e2/6d93295282cb35b53b14b50b602c76dfb04471e21b31d8ad7b Successfully built wrapt lazy-object-proxy Installing collected packages: mccabe, wrapt, lazy-object-proxy, astroid, isort, pylint Successfully installed astroid-2.1.0 isort-4.3.4 lazy-object-proxy-1.3.1 mccabe-0.6.1 pylint-2.2.2 wrapt-1.11.1 $
6 つ入った。
$ pip3 list Package Version ----------------- ------- astroid 2.1.0 cycler 0.10.0 isort 4.3.4 kiwisolver 1.0.1 lazy-object-proxy 1.3.1 matplotlib 3.0.2 mccabe 0.6.1 numpy 1.16.0 pandas 0.23.4 pip 18.1 pylint 2.2.2 pyparsing 2.3.1 python-dateutil 2.7.5 pytz 2018.9 scikit-learn 0.20.2 scipy 1.2.0 setuptools 40.6.3 six 1.12.0 wheel 0.32.3 wrapt 1.11.1 $