问题
I'm using Atom Julia 0.7 on Ubuntu. I'd like to pin the package GDAL to version 0.1.2.
I found this link, Julia: how I "fix" a package at a particular version? but need more detailed information.
Julia> Pkg.pin(PackageSpec(name = “GDAL”, version = “0.1.2”))
Error: the following package names could not be resolved: * GDAL(add… in manifest but not in project) Please specify by known ‘name=uuid’.
回答1:
Before you can pin a package to a specific version, it needs to be added.
As docstring documented, this should work:
Pkg.add(PackageSpec(name = "GDAL", version = "0.1.2"))
Pkg.pin(PackageSpec(name = "GDAL", version = "0.1.2"))
Or in the REPL Pkg mode (]
)
pkg> add GDAL@0.1.2
pkg> pin GDAL@0.1.2
Note that pin by default pins the currently used version, so if you already specify the version on add
, you can leave it out for pin
. The reverse also works, i.e. add the latest version, then pin
an older one.
As an aside, the latest GDAL.jl release, v0.2.0, should work fine on julia 0.7. If it doesn't, please submit an issue :)
来源:https://stackoverflow.com/questions/54215654/how-to-pin-a-package-to-a-certain-version-using-julia-0-7