I installed DifferentialEquations by using:
Pkg.add("DifferentialEquations")
Then I used the below line to check the version:
Pkg.status("DifferentialEquations")
It returns 1.0.0 while, it must be 4.0.0.
I tried Pkg.update() or Pkg.update("DifferentialEquations). However, the version is still 1.0.0 and re-installing Julia did not help neither.
What can be done to update the DifferentialEqautions package?
The version of Julia is 0.6.2.
Edit
This time I not only uninstalled Julia, but I also deleted its folder in appdata. After installing Julia again and adding the package, now it is up to date.
Have you tried :
Pkg.pin("DifferentialEquations",v"4.0.0")
You can force Pkg to find a solution by giving an explicit version.
For example, going from version 5 to version 6 of the DifferentialEquations package:
(TestProject) pkg> status
Status `/tmp/TestProject/Project.toml`
[0c46a032] DifferentialEquations v5.0.0
(TestProject) pkg> add DifferentialEquations#6.0.0
Resolving package versions...
Updating `/tmp/TestProject/Project.toml`
[0c46a032] ↑ DifferentialEquations v5.0.0 ⇒ v6.0.0
Updating `/tmp/TestProject/Manifest.toml`
[1520ce14] - AbstractTrees v0.2.1
[79e6a3ab] - Adapt v1.0.0
[4fba245c] ↓ ArrayInterface v2.3.1 ⇒ v0.1.1
[9e28174c] - BinDeps v1.0.0
...
(TestProject) pkg> status
Status `/tmp/TestProject/Project.toml`
[0c46a032] DifferentialEquations v6.0.0
The equivalent API syntax:
julia> import Pkg
julia> Pkg.add(Pkg.PackageSpec(; name="DifferentialEquations", version=v"6.0.0"))
Related
I am trying to solve this issue.
I understand that my version of the package is outdated (v1.7.2).
However, the package manager thinks I'm on the up-to-date version (v2.3.1).
(#v1.7) pkg> up
Updating registry at `~/.julia/registries/General.toml`
No Changes to `~/.julia/environments/v1.7/Project.toml`
No Changes to `~/.julia/environments/v1.7/Manifest.toml`
(#v1.7) pkg> st Parsers
Status `~/.julia/environments/v1.7/Project.toml`
[69de0a69] Parsers v2.3.1
julia> using Parsers
julia> Parsers.VERSION
v"1.7.2"
If I uninstall/reinstall the problem is still there:
(#v1.7) pkg> rm Parsers
Updating `~/.julia/environments/v1.7/Project.toml`
[69de0a69] - Parsers v2.3.1
No Changes to `~/.julia/environments/v1.7/Manifest.toml`
julia> using Parsers
│ Package Parsers not found, but a package named Parsers is available from a registry.
│ Install package?
│ (#v1.7) pkg> add Parsers
└ (y/n) [y]: y
Resolving package versions...
Updating `~/.julia/environments/v1.7/Project.toml`
[69de0a69] + Parsers v2.3.1
No Changes to `~/.julia/environments/v1.7/Manifest.toml`
julia> using Parsers
julia> Parsers.VERSION
v"1.7.2"
PackageName.VERSION, in contrast to what it intuitively looks like, does not give you the version of the package - it gives you the version of Julia currently installed. So v"1.7.2" refers to your installed version of Julia - you can verify this by loading any other package and trying LoadedPackage.VERSION on them, which should return the same value. (I'm not sure about the reason for such a design - having VERSION be a member of every module - but perhaps there's some value in VERSION being available as a local name within every module namespace.)
So you do have version 2.3.1 of Parsers installed, as the package manager indicates. The source of your original problem must be something else - perhaps it's worth asking as a separate question.
I am trying to install the latest version of Flux.jl with Julia 1.6. When I do add Flux, it adds version Flux v0.8.3 but looking at GitHub, it seems the newest release is version 0.12.x. I have the following packages in my env:
(#v1.6) pkg> st
Status `~/.julia/environments/v1.6/Project.toml`
[5ae59095] Colors v0.9.6
[8f4d0f93] Conda v1.5.2
[7876af07] Example v0.5.3
[587475ba] Flux v0.8.3
[7073ff75] IJulia v1.23.2
[91a5bcdd] Plots v1.0.14
I tried removing Flux and re-adding it already. I also tried:
(#v1.6) pkg> up Flux
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
Updating registry at `~/.julia/registries/JuliaPOMDP`
Updating git-repo `https://github.com/JuliaPOMDP/Registry`
No Changes to `~/.julia/environments/v1.6/Project.toml`
No Changes to `~/.julia/environments/v1.6/Manifest.toml`
and I tried adding the specific version I wanted:
(#v1.6) pkg> add Flux#v0.12.4
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package CodecZlib [944b1d66]:
CodecZlib [944b1d66] log:
├─possible versions are: 0.4.4-0.7.0 or uninstalled
├─restricted by compatibility requirements with StackOverflow [1a8df32f] to versions: 0.6.0
│ └─StackOverflow [1a8df32f] log:
│ ├─possible versions are: 0.1.0-0.1.2 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.1.0-0.1.2
└─restricted by compatibility requirements with Flux [587475ba] to versions: 0.7.0 — no versions left
└─Flux [587475ba] log:
├─possible versions are: 0.4.1-0.12.4 or uninstalled
└─restricted to versions 0.12.4 by an explicit requirement, leaving only versions 0.12.4
which resulted in the error above.
Somehow one of those other packages listed above was causing the Flux version to be upper bounded at v0.8.3 (I am guessing Conda but am not sure). By removing all the packages besides IJulia, I was able to do an up Flux and have it go to [587475ba] ↑ Flux v0.8.3 ⇒ v0.12.4.
I am using Julia version 1.5.1 on a Win10 operating system. Trying to add Plots and Flux results in the errors listed below:
(#v1.5) pkg> add Plots
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Contour [d38c429a]:
Contour [d38c429a] log:
├─Contour [d38c429a] has no known versions!
└─found to have no compatible versions left with Plots [91a5bcdd]
└─Plots [91a5bcdd] log:
├─possible versions are: [0.12.1-0.12.4, 0.13.0-0.13.1, 0.14.0-0.14.2, 0.15.0-0.15.1, 0.16.0, 0.17.0-0.17.4, 0.18.0, 0.19.0-0.19.3, 0.20.0-0.20.6, 0.21.0, 0.22.0-0.22.5, 0.23.0-0.23.2, 0.24.0, 0.25.0-0.25.3, 0.26.0-0.26.3, 0.27.0-0.27.1, 0.28.0-0.28.4, 0.29.0-0.29.9, 1.0.0-1.0.14, 1.1.0-1.1.4, 1.2.0-1.2.6, 1.3.0-1.3.7, 1.4.0-1.4.4, 1.5.0-1.5.9, 1.6.0-1.6.3] or uninstalled
└─restricted to versions * by an explicit requirement, leaving only versions [0.12.1-0.12.4, 0.13.0-0.13.1, 0.14.0-0.14.2, 0.15.0-0.15.1, 0.16.0, 0.17.0-0.17.4, 0.18.0, 0.19.0-0.19.3, 0.20.0-0.20.6, 0.21.0, 0.22.0-0.22.5, 0.23.0-0.23.2, 0.24.0, 0.25.0-0.25.3, 0.26.0-0.26.3, 0.27.0-0.27.1, 0.28.0-0.28.4, 0.29.0-0.29.9, 1.0.0-1.0.14, 1.1.0-1.1.4, 1.2.0-1.2.6, 1.3.0-1.3.7, 1.4.0-1.4.4, 1.5.0-1.5.9, 1.6.0-1.6.3]
(#v1.5) pkg> add Flux
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Flux [587475ba]:
Flux [587475ba] log:
├─Flux [587475ba] has no known versions!
└─restricted to versions * by an explicit requirement — no versions left
I have tried the pkg> update and pkg> gc commands as well, but that did not identify any changes.
The pkg> status yields
(#v1.5) pkg> status
Status `~\.julia\environments\v1.5\Project.toml`
[c3e4b0f8] Pluto v0.11.14
Any suggestions on how to resolve this?
I am new to Julia and tried to run the first example script in the Second Edition of Julia Programming for Operations Research, but the first two lines:
using JuMP, GLPK
m = Model(with_optimizer(GLPK.Optimizer))
throw the following error:
julia> m = Model(with_optimizer(GLPK.Optimizer))
ERROR: MethodError: no method matching supports_default_copy_to(::GLPK.Optimizer, ::Bool)
Closest candidates are:
supports_default_copy_to(::MathOptInterface.Utilities.AbstractModel, ::Bool) at /home/mepstein/.julia/packages/MathOptInterface/C1XBe/src/Utilities/model.jl:693
supports_default_copy_to(::MathOptInterface.Utilities.MockOptimizer, ::Bool) at /home/mepstein/.julia/packages/MathOptInterface/C1XBe/src/Utilities/mockoptimizer.jl:521
supports_default_copy_to(::MathOptInterface.Utilities.CachingOptimizer, ::Bool) at /home/mepstein/.julia/packages/MathOptInterface/C1XBe/src/Utilities/cachingoptimizer.jl:165
In case it's relevant, using JuMP, GLPK threw the following warning:
┌ Warning: Replacing module MathOptInterface
└ # Base loading.jl:942
And my versions are:
Julia: 1.3.1 (latest stable)
"GLPK" => v"0.12.0"
"JuMP" => v"0.20.1"
Issue solved by the book author at https://github.com/chkwon/jpor_codes/issues/4
Running ] up from the julia interpreter upgraded GLPK to 12.1 from 12.0. Interesting because I had just installed GLPK in the first place only a couple hours ago. In fact I'm not even sure I 'upgraded' the installed version; from the log it looks like ] up made certain config files consistent with the version that was already installed?
julia>
(v1.3) pkg> up
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
Resolving package versions...
Installed GLPK ─ v0.12.1
Updating `~/.julia/environments/v1.3/Project.toml`
[60bf3e95] ↑ GLPK v0.12.0 ⇒ v0.12.1
Updating `~/.julia/environments/v1.3/Manifest.toml`
[60bf3e95] ↑ GLPK v0.12.0 ⇒ v0.12.1
Building GLPK → `~/.julia/packages/GLPK/HjJiX/deps/build.log`
In any case, the code in the question above now works and gives the following output:
julia> using JuMP, GLPK
julia> m = Model(with_optimizer(GLPK.Optimizer))
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: GLPK```
I have an error when trying to install any Julia package:
Pkg.add("Combinatorics")
Cloning default registries into `~/.julia`
Cloning registry from "https://github.com/JuliaRegistries/General.git"
Added registry `General` to `~/.julia/registries/General`
Resolving package versions...
ERROR: The following package names could not be resolved:
* Logging (56ddb016-857b-54e1-b83d-db4d58db5568 in manifest but not in project)
Please specify by known `name=uuid`.
What can be done to fix this?
I could fix this problem after the following two steps:
First: (not sure if absolutely needed)
rm(joinpath(homedir(), ".julia", "registries"); recursive=true)
Second: installing the package mentioned as missing in the error message:
Pkg.add("Logging")
Resolving package versions...
Installed MappedArrays ─────────── v0.2.2
Installed IntervalSets ─────────── v0.3.2
Installed PDMats ───────────────── v0.9.10
Installed ColorVectorSpace ─────── v0.7.1
etc
Then my Pkg install worked:
Pkg.add("Combinatorics")
Resolving package versions...
Installed Polynomials ─ v0.6.0
Updating `~/.julia/environments/v1.1/Project.toml`
[861a8166] + Combinatorics v1.0.0
Updating `~/.julia/environments/v1.1/Manifest.toml`
[861a8166] + Combinatorics v1.0.0
[f27b6e38] + Polynomials v0.6.0
julia> using Combinatorics
[ Info: Precompiling Combinatorics [861a8166-3701-5b0c-9a16-15d98fcdc6aa]