How to pin a package to a certain version using Julia 0.7?

醉酒当歌 提交于 2021-01-29 08:22:43

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!