How can I reinstall or recompile already installed packages in Julia?

StackOverflow https://stackoverflow.com/questions/23468381

  •  15-07-2023
  •  | 
  •  

Pergunta

Is it possible to reinstall or recompile an already installed package in Julia? I did not find any hints in the official documentation. whos() did not reveal anything useful either.

Best


As was pointed out in the answer below by @ivarne my question can also be understood as:

"How can I reload a package that has been loaded with import or using in a Julia session?"

This question has also been answered by @ivarne.

Foi útil?

Solução

You can re-run the package build script with Pkg.build("pkgname"). The actual compiling of the packages is just in time so they are complied when you load them.

Outras dicas

Not sure about the terminology you use, but if you think about reloading a package (with import or using), it is complicated and the best approach is to restart Julia.

A function called reload() exists, but it has some limitations. While developing a Package, you might consider using something like the Autoreload.jl package to make it easier to reload the files you are working on.

If you are developing package and heve it installed using dev command, than Base.compilecache(Base.PkgId(PDFIO)) does the job.
In this case PDFIO is the package that I'm working on. It is more convenient than restarting julia.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top