[英]Julia - how to update WinRPM in julia version 0.6.4
I'm new to Julia and I want to use COBRA Package.我是 Julia 的新手,我想使用 COBRA Package。 For adding COBRA I use command:
为了添加 COBRA,我使用命令:
Pkg.add("COBRA")
But when running, I get these errors:但是在运行时,我得到了这些错误:
INFO: Building WinRPM
信息:构建 WinRPM
WARNING: skipping repodata/repomd.xml, not in cache -- call WinRPM.update() to download
警告:跳过 repodata/repomd.xml,不在缓存中——调用 WinRPM.update() 下载
WARNING: skipping repodata/repomd.xml, not in cache -- call WinRPM.update() to download
警告:跳过 repodata/repomd.xml,不在缓存中——调用 WinRPM.update() 下载
INFO: Downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
信息:正在下载https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.Z0F635D0E0F3874FFF8B581C132E6C77A
WARNING: Unknown download failure, error code: 2148270086
警告:未知下载失败,错误代码:2148270086
WARNING: Retry 1/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
警告:重试 1/5 下载: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.Z0F635D0E0F38274FFF87Z581C7A
until:直到:
WARNING: Unknown download failure, error code: 2148270086
警告:未知下载失败,错误代码:2148270086
WARNING: Retry 5/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
警告:重试 5/5 下载: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.Z0F635D0E0F3823E674FFF87B581C
WARNING: received error 0 while downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
警告:下载https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.Z0F635D0E0F3874FFF8B581C132时收到错误 0
After these errors, I have checked the link and I've found out the source is not there, anymore.在这些错误之后,我检查了链接,发现源不存在了。 So then I ran this command as said above:
然后我如上所述运行了这个命令:
WinRPM.update()
But it has thrown this error:但它抛出了这个错误:
ERROR: UndefVarError: WinRPM not defined
错误:UndefVarError:未定义 WinRPM
Please Help me to add COBRA to Julia.请帮我将 COBRA 添加到 Julia。 I'm using version 0.6.4 because Cobra does not work on the next versions.(Windows 10) Any help would be appreciated.
我使用的是 0.6.4 版本,因为 Cobra 不适用于下一个版本。(Windows 10)任何帮助将不胜感激。
The problem, as you've mentioned, is that the original sources used by the package aren't valid URLs anymore.正如您所提到的,问题在于package 使用的原始来源不再是有效的 URL。 The proper way to solve this is to open a pull request with the package to change the URLs (which I've now done here ).
解决此问题的正确方法是使用 package 打开一个拉取请求以更改 URL(我现在在这里完成了)。 As a stopgap measure, here's a hacky way to work around this issue for now:
作为权宜之计,这里有一个解决这个问题的方法:
Pkg.add("WinRPM")
.Pkg.add("WinRPM")
。 This might trigger the same warnings as above, ignore these.using WinRPM
to load the package we addedusing WinRPM
加载我们添加的 packagesources.list
file (linked above) into a global WinRPM.sources
variable.sources.list
文件(上面链接)中读取到全局WinRPM.sources
变量中。 We're going to edit this variable's contents to point to new working URLs.
julia> WinRPM.sources[:] = replace.(WinRPM.sources, "Leap_42.3" => "Leap_15.3")
2-element Vector{String}:
"https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_15.3"
"https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_15.3"
WinRPM.update()
should now work, and download things into a local cache. WinRPM.update()
现在应该可以工作,并将内容下载到本地缓存中。I'm using version 0.6.4 because Cobra does not work on the next versions.
我使用的是 0.6.4 版本,因为 Cobra 不适用于下一个版本。
I hope you mean Julia 1.6.4 here, or version 0.6.4 of something else in the stack.我希望您的意思是 Julia 1.6.4 或堆栈中其他版本的 0.6.4。 If you mean Julia version 0.6.4, you might face further problems down the road and find it hard to get support for such an old version.
如果您的意思是 Julia 版本 0.6.4,您可能会面临更多问题,并且很难获得对这样一个旧版本的支持。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.