如何直接从Github将包添加到Julia?

4

在 Julia (编辑器 - Atom) 中导入 GitHub 上最新版本的 Geostats 包时,我遇到了一个 Unsatisfiable requirements 错误。为了避免软件包之间的冲突,我正在使用虚拟环境。

(Virtualenv) pkg> add https://github.com/JuliaEarth/GeoStats.jl.git
    Cloning git-repo `https://github.com/JuliaEarth/GeoStats.jl.git`
   Updating git-repo `https://github.com/JuliaEarth/GeoStats.jl.git`
   Updating registry at `C:\Users\User\.julia\registries\General`
   Updating registry at `C:\Users\User\.julia\registries\JuliaComputingRegistry`
  Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Variography [04a0146e]:
 Variography [04a0146e] log:
 ├─possible versions are: [0.2.0-0.2.2, 0.3.0-0.3.7, 0.4.0-0.4.3, 0.5.0-0.5.10, 0.6.0-0.6.3, 0.7.0, 0.8.0-0.8.4, 0.9.0-0.9.1, 0.10.0-0.10.4, 0.11.0-0.11.1] or uninstalled
 └─restricted to versions 0.12 by GeoStats [dcc97b0b] — no versions left
   └─GeoStats [dcc97b0b] log:
     ├─possible versions are: 0.23.0 or uninstalled
     └─GeoStats [dcc97b0b] is fixed to version 0.23.0

首先,我想知道从Github直接导入包的方法或语法是否正确?如何解决不可满足条件的问题?

谢谢!

3个回答

4
回答您最初的问题,具体来说,执行add https://the_girhub_clone_url将直接从GitHub添加一个软件包。

感谢您对从Github添加软件包的方法的回答。 - Mohammad Saad

3

此外,文档还介绍了如何理解和解决软件包冲突。

第一次解决这个问题可能会比较复杂,但这是值得学习的生活技能 :-)


2
在您的情况下,问题在于与您的地质统计学兼容的 Variography 版本刚刚发布了几个小时,而您的软件包管理器尚未更新其版本缓存。

请尝试运行:

pkg"update Variography"

您的Julia将意识到新的变异法,并且您将能够安装最新的地质统计学工具。

但是,如果由于其他依赖关系而持续失败,只需降级Geostats即可:

pkg"add GeoStats@v0.22.0"

Szufei,感谢您的建议。我已经尝试更新,但它只能到达最大版本0.11.1,仍然无法访问v 0.12。我该如何将软件包的repo从git克隆到julia中? - Mohammad Saad

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接