Tag Archives: Julia import package

Julia install and use the extension package package (ERROR: UndefVarError: Pkg not defined)

Julia1.0 has just been installed and I want to take the first step:

Pkg.add("PyPlot")

ERROR: ERROR: UndefVarError: Pkg not defined
 
Problem description:
Since Julia’s extension pack is installed using a Pkg extension pack, you must import Julia’s extension pack Pkg before installing the extension pack
 
Solutions:
Import the Pkg package
Then use the pkg. add() command

using Pkg
Pkg.add("Packagename")