Adding Julia packages to Jupyter

The standard installation for Julia under Jupyter has many packages that are commonly used in Julia programming. However, if you do need to add another package, a small number of steps are required to be followed:

  1. Close down your Notebook (including the server).
  2. Run the Julia command-line program:
Pkg.add("DataFrames") 
Pkg.add("RDatasets") 
quit(); 
  1. Restart your Notebook. The package should be available in your Julia script, for example,  library("name of the package you want to add").

I would recommend adding the preceding two packages right away, as they are needed for many scripts.

The first time you use a package in Julia, you will see a line highlighted in light red that shows Julia is precompiling, such as this: INFO: Precompiling module Dataframes...

You can use the Pkg.add(...) function directly in your script, but that doesn't seem correct. Every time you run your script, the system will attempt to validate whether you have the specified package, install it into your environment if needed, and even tell you whether it is out of date. None of these steps belong to part of your script.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.190.156.80