LoginSignup
12
12

More than 5 years have passed since last update.

Juliaインストール

Last updated at Posted at 2016-12-07

こんにちは。Livesense Advent Calendar 2016 その2、8日目を担当させて頂くfkm_yです。

はじめに

アドベントカレンダーのネタが思いつかず困っていたら
Juliaいいよと聞いたのでJuliaを触ってみました。

Juliaとは

  • 機械学習や統計で使われる計算向け言語
  • RやPythonに比べて高速

公式サイト http://julialang.org

Juliaのインストール

mac上でbrewを使ってJuliaをインストールする。
(結構時間がかかる。。)

$ brew update
$ brew tap staticfloat/julia
$ brew install julia

参考 https://github.com/staticfloat/homebrew-julia/

起動/動作確認

インストールが完了したら起動確認する。

正常にインストールされると下記のようなメッセージが出る。

$ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.0-dev.1392 (2016-12-04 14:17 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit cdabda1* (0 days old master)
|__/                   |  x86_64-apple-darwin16.1.0



julia> 123 - 30
93

確認が終わったらjulia> exit()で終了

ブラウザ上で動作させる

書いたコードの結果をグラフで表示して確認できるようにするために
Webブラウザ上で動作する任意の言語の記述・実行・表示を行うサービスJupyterを導入します。
JupyterはPythonで書かれているため、Pythonのインストールも必要になる。

Pythonインストール

mac上でbrewを使ってJuliaをインストールする。

 $ brew install python
 $ pip install --upgrade pip

ipythonインストール

 $ pip install ipython
 $ pip install ipython[notebook]

Juliaパッケージインストール

IJuliaをインストール
IJulia:Webブラウザ上でJuliaを動作させるためのパッケージ

 julia> Pkg.add("IJulia") 

jupyter起動

 julia> using IJulia
 julia> notebook()

または

  $ ipython notebook
12
12
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
12
12