# How to pin a package to previous version on Julia 1.0?

**URL:** https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661
**Category:** General Usage
**Tags:** question
**Created:** [August 18, 2018, 2:13pm UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661 "2018-08-18T14:13:20Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![standarddeviant](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/standarddeviant/32/2309_2.png) [@standarddeviant](https://discourse.julialang.org/u/standarddeviant)
#### Post date: [August 18, 2018, 2:13pm UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661/1 "2018-08-18T14:13:21Z")

</div>

I was following this thread:

> [@Pkg3 plan and status](https://discourse.julialang.org/t/pkg3-plan-and-status/9763/52):
>
> ok, this is getting confusing now. we said: but then you say So: what’s the difference between “which JSON”, a “specific version of JSON” and the “specific package called JSON”? I am asking because every now and then it’s very useful to be able to Pkg.pin(JSON,version) in case of a bug somewhere. Would I have to go and find a previous uuid of JSON to be able to do that with Pkg3? If I should just RTFM please tell me, I haven’t read anything except this thread. thanks!

But wanted to ask something very specific. Now that 1.0 is released, how can I pin a package to a specific, older version? Here’s a concrete example. On Julia v0.6.4, the following works:

```julia
Pkg.pin("Blink", v"0.6.2")
Pkg.pin("PlotlyJS", v"0.10.2")

```

How could one accomplish the same behavior on Julia v1.0.0 ?

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [August 18, 2018, 2:22pm UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661/2 "2018-08-18T14:22:58Z")

</div>

Thats what the help says (on 0.7):

```julia
(v0.7) pkg> ?pin
  pin pkg[=uuid] ...

  Pin packages to given versions, or the current version if no version is
  specified. A pinned package has its version fixed and will not be upgraded
  or downgraded. A pinned package has the symbol ⚲ next to its version in the
  status list.

(v0.7) pkg> 

```

So if you have Blink v0.6.2 and PlotlyJS v0.10.2 installed,

```julia
pin Blink
pin PlotlyJS

```

should be sufficient.

---

<div class="post-metadata">

### Author: ![standarddeviant](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/standarddeviant/32/2309_2.png) [@standarddeviant](https://discourse.julialang.org/u/standarddeviant)
#### Post date: [August 18, 2018, 2:25pm UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661/3 "2018-08-18T14:25:08Z")

</div>

That makes sense. How can I resolve the uuid of v"0.6.2" of Blink and v"0.10.2" of PlotlyJS?

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [August 18, 2018, 2:27pm UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661/4 "2018-08-18T14:27:38Z")

</div>

If you just want to pin the current version the uuid is not required.

---

<div class="post-metadata">

### Author: ![standarddeviant](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/standarddeviant/32/2309_2.png) [@standarddeviant](https://discourse.julialang.org/u/standarddeviant)
#### Post date: [August 18, 2018, 2:28pm UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661/5 "2018-08-18T14:28:11Z")

</div>

That makes sense as well. But what if I want to pint to a specific, older version of the code?

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [August 18, 2018, 2:59pm UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661/6 "2018-08-18T14:59:02Z")

</div>

The uuid refers to the package, not the version. If you want to pin a specific version, use `add` to obtain it, then `pin` to pin it.

```julia
(v0.7) pkg> add Blink
[...]

(v0.7) pkg> st
    Status `~/.julia/environments/v0.7/Project.toml`
  [ad839575] Blink v0.7.0

(v0.7) pkg> add Blink@0.6.2
 Resolving package versions...
  Updating `~/.julia/environments/v0.7/Project.toml`
  [ad839575] ↓ Blink v0.7.0 ⇒ v0.6.2
  Updating `~/.julia/environments/v0.7/Manifest.toml`
  [ad839575] ↓ Blink v0.7.0 ⇒ v0.6.2
[...]

(v0.7) pkg> st
    Status `~/.julia/environments/v0.7/Project.toml`
  [ad839575] Blink v0.6.2

(v0.7) pkg> pin Blink
 Resolving package versions...
  Updating `~/.julia/environments/v0.7/Project.toml`
  [ad839575] ~ Blink v0.6.2 ⇒ v0.6.2 ⚲
  Updating `~/.julia/environments/v0.7/Manifest.toml`
  [ad839575] ~ Blink v0.6.2 ⇒ v0.6.2 ⚲

(v0.7) pkg> st
    Status `~/.julia/environments/v0.7/Project.toml`
  [ad839575] Blink v0.6.2 ⚲
```

---

<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, 11:22am UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661/7 "2019-01-16T11:22:55Z")

</div>

I tried this as I need package “GDAL” of version 0.1.2 pinned in Julia 0.7. But it does not work as expected.

(v0.7) pkg\> add GDAL@0.1.2  
Resolving package versions…  
Updating `~/.Julia/environments/v0.7/Project.toml [add2ef01] + GDAL v0.2.0 updating `~/.Julia/environments/v0.7/Manifest.toml`

strange behavior?

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [January 16, 2019, 11:24am UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661/8 "2019-01-16T11:24:01Z")

</div>

You are posting the same question in multiple places. There is no need for that.

---

<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, 11:25am UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661/9 "2019-01-16T11:25:14Z")

</div>

oh. Thank you for letting me know. I will delete one if I get a solution.

---

<div class="post-metadata">

### Author: ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)
#### Post date: [January 16, 2019, 12:00pm UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661/10 "2019-01-16T12:00:33Z")

</div>

No need to delete it now. The reason for this is to prevent people putting time into answering your question, when it might have already been answered elsewhere.

Short answer is you first have to add the package before pinning it, for full answer see: [How to pin a package to a certain version using Julia 0.7? - Stack Overflow](https://stackoverflow.com/a/54216576/2875964)

---

<div class="post-metadata">

### Author: ![programista](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/programista/32/5372_2.png) [@programista](https://discourse.julialang.org/u/programista)
#### Post date: [April 5, 2019, 9:41am UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661/11 "2019-04-05T09:41:24Z")

</div>

What wrong in Pkg.pin(“DataFrames”,v"0.17.1") ?

> julia\> versioninfo()  
> Julia Version 0.7.0  
> Commit a4cb80f3ed (2018-08-08 06:46 UTC)  
> Platform Info:  
> OS: Windows (x86\_64-w64-mingw32)  
> CPU: Intel(R) Core™ i7-2630QM CPU @ 2.00GHz  
> WORD\_SIZE: 64  
> LIBM: libopenlibm  
> LLVM: libLLVM-6.0.0 (ORCJIT, sandybridge)  
> julia\> using Pkg
> 
> julia\> Pkg.status()  
> Status `C:\Users\progr\.julia\environments\v0.7\Project.toml`  
> [a93c6f00] DataFrames v0.17.1 ⚲  
> [e7dc6d0d] DataValues v0.4.7  
> [89b67f3b] ExcelFiles v0.9.1  
> [c04bee98] ExcelReaders v0.11.0  
> [91a5bcdd] Plots v0.19.3  
> [d71aba96] ReadStat v0.4.1  
> [1463e38c] StatFiles v0.8.0  
> [c17dfb99] WinRPM v0.4.2  
> [bd07be1c] Winston v0.14.1  
> [fdbf4ff8] XLSX v0.4.7
> 
> julia\> Pkg.pin(“DataFrames”,v"0.17.1")  
> ERROR: MethodError: no method matching pin(::String, ::VersionNumber)  
> Closest candidates are:  
> pin(::Union{String, PackageSpec}; kwargs…) at C:\cygwin\home\Administrator\buildbot\worker\package\_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\API.jl:192  
> Stacktrace:  
> [1] top-level scope at none:0

Paul

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [April 5, 2019, 9:45am UTC](https://discourse.julialang.org/t/how-to-pin-a-package-to-previous-version-on-julia-1-0/13661/12 "2019-04-05T09:45:40Z")

</div>

Either `pin DataFrames@0.17.1` in Pkg REPL mode or

```julia
using Pkg
Pkg.pin(PackageSpec(name="DataFrames", version="0.17.1"))

```
