gpt4 book ai didi

Julia 从 github 添加包

转载 作者:行者123 更新时间:2023-12-04 12:23:07 26 4
gpt4 key购买 nike

我想从 github 安装以下包。我尝试在我的环境中使用以下命令进行安装

(nlpEnvJl) pkg> add "https://github.com/yeesian/LeafletJS.jl/tree/master/src"
但我收到以下错误,
错误:在 https://github.com/yeesian/LeafletJS.jl 处的包中找不到项目文件也许 subdir需要指定
关于如何安装的任何想法?我必须先将它克隆到我的本地存储库吗?如果是这样,我如何从本地路径安装?
干杯
提前致谢

最佳答案

您必须在本地克隆它,然后使用 Pkg.generate以便将其作为包导入。它需要一个 Project.toml要添加的文件。
因此,您必须:

$ git clone git@github.com:yeesian/LeafletJS.jl.git                                                                                                                                                                                       
Cloning into 'LeafletJS.jl'...
remote: Enumerating objects: 59, done.
remote: Total 59 (delta 0), reused 0 (delta 0), pack-reused 59
Receiving objects: 100% (59/59), 14.83 KiB | 197.00 KiB/s, done.
Resolving deltas: 100% (22/22), done.
$ julia

(@v1.5) pkg> generate LeafletJS
Generating project LeafletJS:
LeafletJS/Project.toml
LeafletJS/src/LeafletJS.jl

$ cp -r LeafletJS.jl/* LeafletJS/.
$ cd LeafletJS
LeafletJS $ julia

(@v1.5) pkg> dev .
[ Info: Resolving package identifier `.` as a directory at `/tmp/jl_temp/LeafletJS/`.
Path `.` exists and looks like the correct package. Using existing path.
Resolving package versions...
Updating `~/.julia/environments/v1.5/Project.toml`
[b1ddfcb9] + LeafletJS v0.1.0 `../../../../../tmp/jl_temp/LeafletJS`
Updating `~/.julia/environments/v1.5/Manifest.toml`
[b1ddfcb9] + LeafletJS v0.1.0 `../../../../../tmp/jl_temp/LeafletJS`

关于Julia 从 github 添加包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65914480/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com