Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need re-add packages after upgrade Julia

Tags:

julia

I upgrade Julia from v1.1 to v1.3 on win10, but the packages miss in new version.

In v1.1

$ julia_1.1
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.0 (2019-01-21)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.1) pkg> status
    Status `C:\Users\User\.julia\environments\v1.1\Project.toml`
  [c52e3926] Atom v0.11.3
  [4c0ca9eb] Gtk v0.18.0
  [f67ccb44] HDF5 v0.12.4
  [4138dd39] JLD v0.9.1
  [e5e0dc1b] Juno v0.7.2
  [23992714] MAT v0.6.0
  [91a5bcdd] Plots v0.26.3
  [b8865327] UnicodePlots v1.1.0
  [8f399da3] Libdl

But these packages does not show in v1.3

$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.3.0 (2019-11-26)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.3) pkg> status
    Status `C:\Users\User\.julia\environments\v1.3\Project.toml`
  [c52e3926] Atom v0.11.3
  [67c07d97] Automa v0.8.0
  [e5e0dc1b] Juno v0.7.2

I tried using update but still not show.

And I make sure DEPOT_PATH has same folder ("C:\\Users\\User\\.julia") and all added package in there.

# (in v1.3)
julia> DEPOT_PATH
3-element Array{String,1}:
 "C:\\Users\\User\\.julia"
 "D:\\app\\Julia\\1.3.0\\local\\share\\julia"
 "D:\\app\\Julia\\1.3.0\\share\\julia"

How do I resolve it? And in I memory, it will not happen in Linux, is it correct? (I use different version in docker with same volume.)

like image 699
sppmg Avatar asked Dec 07 '19 13:12

sppmg


People also ask

Where are Julia packages stored?

By default, packages will be installed to ~/. julia/packages . To exit package mode, enter the Backspace key on an empty line.

How do I add multiple packages to Julia?

You can use Pkg to install multiple packages (https://github.com/JuliaLang/julia/issues/19591). For instance: Pkg. add(["Combinatorics", "TaylorSeries"]) . If your list sits in a text file, you can just load it and pass it to Pkg.

What version of Julia should I upgrade to?

I recommend upgrading to Julia 1.3.1 if you haven’t already; it’s quite a bit faster at some things. What are Julia packages? Unlike software packages like MATLAB and Stata, much of Julia’s functionality is found in external packages.

How to add multiple packages to a Julia Project?

It is possible to add multiple packages in one command as pkg> add A B C. After a package is added to the project, it can be loaded in Julia: julia> using Example julia> Example.hello ("User") "Hello, User" A specific version can be installed by appending a version after a @ symbol, e.g. @v0.4, to the package name:

What is a package update in Julia?

Julia’s package manager provides tools to make sure your code won’t break in the future because of a package update. Updating `~/.julia/environments/v1.3/Manifest.toml` says we are updating the file Manifest.toml. The Manifest is more detailed than the Project file.

How do I install a specific version of a Julia Project?

A specific version can be installed by appending a version after a @ symbol, e.g. @v0.4, to the package name: (v1.0) pkg> add [email protected] Resolving package versions... Updating `~/.julia/environments/v1.0/Project.toml` [7876af07] + Example v0.4.1 Updating `~/.julia/environments/v1.0/Manifest.toml` [7876af07] + Example v0.4.1


1 Answers

Each minor and major Julia version (MAJOR.MINOR.PATCH) uses its own environment named vMAJOR.MINOR. For example, for Julia 1.3.0 the environment is named v1.3 as you can see indicated in the Pkg REPL mode in parentheses before the pkg>.

When you updated from 1.1.x to 1.3.0 you hence switch from environment v1.1 to v1.3, which doesn't contain any packages by default. This happens on every OS.

How to we carry over packages from, say, v1.1 to v1.3?

The environments are reflected in folders in .julia/enironments. The two files Manifest.toml and Project.toml in those folders represent the respective environment. You can simply create a copy of the folder v1.1 and name it v1.3. Then, you fire up you Julia 1.3 REPL and, to be safe, you execute ] instantiate which will make sure that everything is installed properly. That's it.

For more information on environments see here and here.

like image 113
carstenbauer Avatar answered Oct 03 '22 04:10

carstenbauer