julia1.0 でのパッケージのインストール

はじめに、祝 1.0 なわけですが、いきなり、つまずきました。

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.0 (2018-08-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> Pkg.add()
ERROR: UndefVarError: Pkg not defined
Stacktrace:
 [1] top-level scope at none:0

julia> quit()
ERROR: UndefVarError: quit not defined
Stacktrace:
 [1] top-level scope at none:0

素の julia の機能しか使えないに加えて、終了もできないのです。

Pkg.jl のマニュアルを読むことになります。

Getting Started
The Pkg REPL-mode is entered from the Julia REPL using the key ].

Pkg REPL モードなるものが、導入ですか!!
"]"を押すのですか!!
何も書いていませんが、Pkg.add() は、使えなくなるのですね!!!

(v1.0) pkg> add("DataFrames")
ERROR: expected command. instead got [add(]

(v1.0) pkg> got("DataFrames")
ERROR: expected command. instead got [got(]

(v1.0) pkg> add DataFrames
   Cloning default registries into /Users/xxxxxx/.julia/registries
   Cloning registry General from "https://github.com/JuliaRegistries/General.git"
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed WeakRefStrings ───── v0.5.1
 Installed Reexport ─────────── v0.2.0

(以下略)

立上げた時の大きな "julia" の横に、なにげに、"Type "?" for help, "]?" for Pkg help." と、書いてありますね。

"?" で即"りたーん"キーを押すと、

help?>
search: ⊻ ⊋ ⊊ ⊉ ⊈ ⊇ ⊆ ≥ ≤ ≢ ≡ ≠ ≉ ≈ ∪ ∩ ∛ √ ∘ ∌ ∋ ∉ ∈ ℯ π ÷ ~ | ^ \ > < : / - + * & % ! if do IO |> rm pi mv in im fd cp cd GC >> >= >: => == <= << <: // !=
Welcome to Julia 1.0.0. The full manual is available at
https://docs.julialang.org/
as well as many great tutorials and learning resources:
https://julialang.org/learning/
For help on a specific function or macro, type ? followed by its name, e.g. ?cos, or ?@time, and press enter. Type ; to enter shell mode, ] to enter package mode.

ここにも "] to enter package mode." と、書いてある。

さて、quit() ですが、"To exit the interactive session, type CTRL-D (press the Control/^ key together with the d key), or type exit(). " らしいです。

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.0 (2018-08-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> exit()

[プロセスが完了しました]


めでたし、めでたし。でも、"CTRL-D" を押すと一瞬で終了するのは、ちょっと怖い気がします。

B! LINE