简体   繁体   中英

How to update to Julia 0.7 on MacOs without installing packages again

I am a user of Julia v0.6, no issues to report. I am trying to update to Julia v0.7. I already have the CMD line version installed.

I copied the packages over from the v0.6 folder into my packages folder that came with v0.7.

Here is an image of my file structure in finder.

在此处输入图片说明

I see the packages in the "Packages" folder you see above. However, when I try "using SHERPA" for example(SHERPA is a package in the "Packages" folder), it says it's not installed. I thought maybe Pkg.init() would fix the problem but that command is deprecated on v0.7 so I don't know what to do.

I have already looked at the other StackOverflow questions and those didn't resolve my issue. I also already tried Pkg.resolve() and Pkg.Update() to no avail.

I appreciate your support.

Edit W/Solution:

At the time of this writing, I am running MacOs Mojave on my Mac and would suggest at least MacOs High Sierra since the file structure was changed in there.

Install Julia 0.7: https://julialang.org/downloads/ Note: if you don't see v0.7 on the link above, go here: https://julialang.org/downloads/oldreleases.html

Once v0.7 is installed, make sure it dragged into your application folder.

Run the program. Type "Pkg.resolve()" and "Pkg.Update()" in the Julia Terminal window that appears.

Then Run:
Pkg.add("JSON") in order to get your packages file to show up...

This should make it so the new package management system is enabled. You can confirm that by checking your ".julia" folder(which can be accessed but going to finder - clicking Command-Shift-H and then Command-Shift-.)

You should see an "environments", "packages" and "registries" folder(in addition to probably a few others). Note as of now, due to the new package manager, you either cannot or I don't know how to, clone a project from GitHub desktop to your packages folder.

To add a custom-made package: open command line version v0.7 Type "]". You should see "(v0.7) pkg> " in blue text. Note use "Control"-"c" to exit Pkg mode in terminal. Type " add https://github.com/xxxxxxx/xxxxxxx.git " Type " add https://github.com/xxxxxx/xxxxxxx.git " Note: follow any on-screen prompts(ie "Type PKg.resolve() or Pkg.update() ")

Note: you will probably see many depreciation warning when you run your old code.

How to use the new Pkg manager in Julia v0.7: https://docs.julialang.org/en/v1/stdlib/Pkg/index.html

This is not possible and/or not recommended for the following reasons:

  1. The package manager is completely new in Julia v0.7/v1.0 compared to the one in Julia v0.6. In particular, the new package manager does not understand the old package managers folder structure and method of installation (git cloning). As a sidenote, the packages folder is not supposed to be modified by users, it is controlled by Pkg, and, in particular, putting something in the packages folder does not mean it is installed.

  2. Since there have been very many changes between Julia v0.6 and v0.7/v1.0 is is unlikely that the same package versions that you use on Julia v0.6 works on newer Julia versions, so you don't really gain anything from copying, since you need to "reinstall" new versions anyway.

I would also like to point out that the new package manager is much faster compared to the old one, so

pkg> add PackageA PackageB ...

to add all the packages you use should not take more than a minute.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM