Macでpython3の環境構築3---ライブラリのインストール---
今回の投稿はそれほど手順は多くないのですが、この次の記事がいろいろ複雑なので、忘れないうちに、さっさとこの記事は作ってしまおう。
前回、前々回でHomebrewをイントールし、python3をインストールしました。
そこまでできてしまえば、今回はすぐ終わります。
今回はNumpyとNetworkxとscikit-learnのインストール方法を紹介します。
Numpyのインストール
順不同ですが、まずはNumpyから。
ターミナルを開き、カーソルが点滅しているところに次のようなコマンドを打つだけです。
hiroshi-no-MacBook-Air:~ hiroshi$ pip3 install numpy # 「pip3 install numpy」というコマンドを打ち、returnを押す。
そうすると、以下のような処理が始まります。
You are using pip version 7.1.0, however version 7.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting numpy
Downloading numpy-1.9.2-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.7MB)
100% |████████████████████████████████| 3.7MB 91kB/s
Installing collected packages: numpy
Successfully installed numpy-1.9.2
hiroshi-no-MacBook-Air:~ hiroshi$
Successfully installed numpy-1.9.2
と出ているので、無事インストール完了です。
Networkxのインストール
同様に、
hiroshi-no-MacBook-Air:~ hiroshi$ pip3 install networkx # 「pip3 install networkx」というコマンドを打ち、returnを押す。
と打つと、
You are using pip version 7.1.0, however version 7.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting networkx
Downloading networkx-1.10.tar.gz (1.2MB)
100% |████████████████████████████████| 1.2MB 316kB/s
Collecting decorator>=3.4.0 (from networkx)
Downloading decorator-4.0.2-py2.py3-none-any.whl
Building wheels for collected packages: networkx
Running setup.py bdist_wheel for networkx
Stored in directory: /Users/hiroshi/Library/Caches/pip/wheels/5d/de/da/01c04502599d67f0b7830214036cd909f211240dbeb23a796c
Successfully built networkx
Installing collected packages: decorator, networkx
Successfully installed decorator-4.0.2 networkx-1.10
hiroshi-no-MacBook-Air:~ hiroshi$
となります。
scikit-learnのインストール
また同様に、
hiroshi-no-MacBook-Air:~ hiroshi$ pip3 install scikit-learn # 「pip3 install scikit-learn」というコマンドを打ち、returnを押す。
とすれば、
You are using pip version 7.1.0, however version 7.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting scikit-learn
Downloading scikit_learn-0.16.1-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (5.1MB)
100% |████████████████████████████████| 5.1MB 82kB/s
Installing collected packages: scikit-learn
Successfully installed scikit-learn-0.16.1
hiroshi-no-MacBook-Air:~ hiroshi$
となります。