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

**URL:** https://discourse.julialang.org/t/error-methoderror-no-method-matching-pin-string-versionnumber/19672
**Category:** Visualization
**Tags:** question
**Created:** [January 15, 2019, 5:49pm UTC](https://discourse.julialang.org/t/error-methoderror-no-method-matching-pin-string-versionnumber/19672 "2019-01-15T17:49:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)
#### Post date: [January 15, 2019, 5:49pm UTC](https://discourse.julialang.org/t/error-methoderror-no-method-matching-pin-string-versionnumber/19672/1 "2019-01-15T17:49:18Z")

</div>

I was using Julia 0.7 to install a package JEMSS.jl from this link: [https://github.com/uoa-ems-research/JEMSS.jl](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?

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [January 15, 2019, 6:41pm UTC](https://discourse.julialang.org/t/error-methoderror-no-method-matching-pin-string-versionnumber/19672/2 "2019-01-15T18:41:48Z")

</div>

You can just add the version explicitly (see the [docs](https://julialang.github.io/Pkg.jl/v1/api/)):

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

```

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

```julia
Pkg.pin("GDAL")

```

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

---

<div class="post-metadata">

### Author: ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)
#### Post date: [January 15, 2019, 7:26pm UTC](https://discourse.julialang.org/t/error-methoderror-no-method-matching-pin-string-versionnumber/19672/4 "2019-01-15T19:26:10Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [January 15, 2019, 7:28pm UTC](https://discourse.julialang.org/t/error-methoderror-no-method-matching-pin-string-versionnumber/19672/5 "2019-01-15T19:28:23Z")

</div>

Did you `using Pkg` first?

---

<div class="post-metadata">

### Author: ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)
#### Post date: [January 15, 2019, 9:13pm UTC](https://discourse.julialang.org/t/error-methoderror-no-method-matching-pin-string-versionnumber/19672/6 "2019-01-15T21:13:16Z")

</div>

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

---

<div class="post-metadata">

### Author: ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)
#### Post date: [January 16, 2019, 8:57am UTC](https://discourse.julialang.org/t/error-methoderror-no-method-matching-pin-string-versionnumber/19672/8 "2019-01-16T08:57:58Z")

</div>

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