Julia Package has "no known versions!" when trying to add a package - julia

I am getting an error when I try to add a package in Julia. It is saying the package I am trying to add has "no known versions!". What can I do to resolve this?

This is a common issue when you lose connection to the Julia Registry (which is where packages are pulled from). You can first type ] to enter pkg mode in the Julia Repl and then do the following:
(#v1.5) pkg> registry remove General
Removing registry `General` from ~/.julia/registries/General
(#v1.5) pkg> registry add https://github.com/JuliaRegistries/General.git
Cloning registry from "https://github.com/JuliaRegistries/General.git"
Added registry `General` to `~/.julia/registries/General`
Try to add the Package again and the issue should be resolved.

Related

Run Pkg.instantiate() error when importing julia package

I have added a package Relief.jl to my environment. I have also checked if it's available by typing stand it's listed under available packages for the environment. However when I type using Relief I get the following error,
ERROR: ArgumentError: Package Relief [e59a39ae-ffc4-11ea-35a5-2b2996f35250] is required but does not seem to be installed:
- Run Pkg.instantiate() to install all recorded dependencies.
Any ideas what I should do to resolve this?
You need to run the command: ] build "name of package" in the terminal. This should fix the problem.
(Without the speech marks. That is just to highlight its a name)

Cannot install any package in Julia

I had used Julia some months back for a project, and didn't use it since. I hadn't faced problems back then. But now, I absolutely am not able to install any package.
(#v1.5) pkg> add Distributions
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Distributions [31c24e10]:
Distributions [31c24e10] log:
├─Distributions [31c24e10] has no known versions!
└─restricted to versions * by an explicit requirement — no versions left
Any package I install, I am getting the same error. How do I fix it?
This is the status of Pkg:
(#v1.5) pkg> status
Status `C:\Users\jaine\.julia\environments\v1.5\Project.toml`
[6e4b80f9] BenchmarkTools v0.5.0
[7073ff75] IJulia v1.21.2
[91a5bcdd] Plots v1.6.0
[438e738f] PyCall v1.91.4
[d330b81b] PyPlot v2.9.0
[2913bbd2] StatsBase v0.33.0
Given
├─Distributions [31c24e10] has no known versions!
it looks like you have a missing or corrupt package registry. The package manager will reinstall it for you if you delete .julia/registries and try to add the package again.
You can do this from within julia
rm(joinpath(homedir(), ".julia", "registries"), recursive=true, force=true)
These are indeed some of the more tricky situations to resolve so please bear with me as we work through this.
If you are not familiar with the basics of the package manager, it's worth a quick read to check out: https://julialang.github.io/Pkg.jl/v1/getting-started/
Assuming you are now in the Julia Repl, my general work flow for these issues is to remove everything it warns me about. The core problem here is that one of your existing packages is saying it needs a specific version of Distributions.jl but it's not able to add it. So, the first step would be to enter the pkg manager by doing ] and type rm Distributions.
Then, while still in the pkg mode, do resolve and add Distributions.
So the process is to just remove each package the Repl complains about until it stops complaining.
Note: If you run into something like this again, the worst-case scenario is to remove the project and manifest files for the specific Julia version you are using. If you navigate to ".julia/environments" you should be able to completely reset the Julia Env for a specific version there (that way you don't need to actually reinstall Julia).

Trying to add IJulia via the REPL: Unsatisfiable requirements detected for package

I keep trying to add IJulia in the REPL, and I keep getting this error message:
I tried installing JSON directly, but the REPL would say "The following packages names could not be resolved".
If it helps, I'm running a Windows 10 laptop with julia 1.0.5
Is there a fix to this? Should I install an earlier version to julia?
Appreciate the time.
It seems like you have outdated registries locally.
The registries are ~/.julia/registries, message like The following package names could not be resolved usually suggests that registry are not updated or somehow corrupted.
Delete them (the directory ~/.julia/registries/General) and then adding packages should cause the General registry to be downloaded, the newest version. Then you should be able to add IJulia without problem.
More people encountered this problem with messed up registry, see https://discourse.julialang.org/t/registry-failed-to-update/17840/10

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.
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.

Adding a package in Julia "ERROR The following package names could not be resolved"

When trying to add a package on Julia, I keep getting these message.
Pkg.add("Taro")
ERROR: The following package names could not be resolved:
* Taro (not found in project, manifest or registry)
Please specify by known `name=uuid`.
The warning only pops up when installing certain packages.
I have also tried to use:
get glone http://aviks.github.io/Taro.jl/ , but has not worked neither.
Thank you in advance for your help.
Rodrigo
The package is registered but doesn't seem to be ready for Julia 1.0.
You can (force) add it from it's github repository. It's located at https://github.com/aviks/Taro.jl. Hence, you can either
] add https://github.com/aviks/Taro.jl
or equivalently
using Pkg
Pkg.add("https://github.com/aviks/Taro.jl")
However, building the package will fail on Julia 1.0. Note that the URL that you mention, http://aviks.github.io/Taro.jl/, is only the packages documentation.

Resources