ERROR: MethodError: no method matching pin(::String, ::VersionNumber)

question

#1

I was using Julia 0.7 to install a package JEMSS.jl from this link: https://github.com/uoa-ems-research/JEMSS.jl
During the process, I need to use the Julia 0.6 command
“Pkg.pin( “GDAL”, v"0.1.2” )"
But when I tried it. I got an error like the following:
ERROR: MethodError: no method matching pin(::String, ::VersionNumber)
Can anyone point to me how to pin a package to a certain version in Julia 0.7?
Moreover, can I understand that Julia version 0.7 is an intermediate between 0.6 and 1.0? So if is it possible that I can combine code written in Julia 0.6 with package written in Julia 1.0 without too much efforts?


#2

You can just add the version explicitly (see the docs):

Pkg.add(PackageSpec(name="GDAL", version="0.1.2"))

and if you really feel like it you can pin it afterwards:

Pkg.pin("GDAL")

Note that the new package manager does not update as aggressively, so the pin might be superfluous.


#4

Just tried the command
Pkg.add(PackageSpec(name=“GDAL”, version=“0.1.2”)) and got an error saying that “PackageSpec” is not recognised. I guess it’s because I’m using Julia version 0.7. not version 1.0.


#5

Did you using Pkg first?


#6

Here are updates: I tried
using Pkg
Pkg.add(PackageSpec(name = “GDAL”, version = “0.1.2”))
Pkg.pin(“GDAL”)
Pkg.installed(“GDAL”)

in the end, Pkg.installed(“GDAL”) still gives me v"0.2.0". It simply does not work in Julia 0.7. Or maybe I need to do this manually by my hand to delete the un-liked version and copy and paste the liked version. :wink:


#8

this is really strange. I will post this as a new question to get more attention.