Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use an unregistered package in Julia?

I want to use a package I found online, but I get the following error:

(Example) pkg> add Unregistered
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
ERROR: The following package names could not be resolved:
 * Unregistered (not found in project, manifest or registry)
Please specify by known `name=uuid`.

I have seen others use the add command, but it does not seem to work in this case.

like image 269
David Varela Avatar asked Sep 17 '19 20:09

David Varela


People also ask

What is an unregistered package?

Unregistered post will be delivered without any signature or receipt taken by the recipient and for sure cannot be tracked. In case of non delivery , nothing can be done I guess. But for Registered post , postman has to take signature from the recipient , so a safer option.

How do I import a package to Julia?

To install packages, use Pkg , Julia's built-in package manager, to add packages to your active environment. To use packages already in your active environment, write import X or using X , as described in the Modules documentation.

How do I register my Julia package?

To register your package: Go to the Registrator repository. Click the install app button to install the Julia Registrator application. In your package repository, create a new issue.

How do you enter a PKG in Julia?

Enter the Pkg REPL by pressing ] from the Julia REPL. To get back to the Julia REPL, press backspace or ^C.


1 Answers

To add an unregistered package, refer to it by URL:

(Example) pkg> add https://github.com/00vareladavid/Unregistered.jl
  Updating git-repo `https://github.com/00vareladavid/Unregistered.jl`
  Updating git-repo `https://github.com/00vareladavid/Unregistered.jl`
 Resolving package versions...
  Updating `~/.julia/environments/Example/Project.toml`
  [dcb67f36] + Unregistered v0.2.0 #master (https://github.com/00vareladavid/Unregistered.jl)
  Updating `~/.julia/environments/Example/Manifest.toml`
  [7876af07] + Example v0.5.3
  [dcb67f36] + Unregistered v0.2.0 #master (https://github.com/00vareladavid/Unregistered.jl)

Pkg will automatically install its dependencies.

After you have added the package, you can use it normally:

julia> import Unregistered
[ Info: Precompiling Unregistered [dcb67f36-efa0-11e8-0cef-2fc465ed98ae]

Note: Packages must have a toplevel Project.toml file with name, UUID, and version fields.

like image 185
David Varela Avatar answered Oct 22 '22 13:10

David Varela