安装CairoMakie包

import Pkg; Pkg.add("CairoMakie")
using CairoMakie
CairoMakie.activate!()
ERROR: LoadError: InitError: could not load library "C:\Users\DELL\.julia\artifacts\f9f799e6ae3fe7f244bb55052db7ff1cea876c27\bin\libgettextlib-0-21.dll"
The specified module could not be found. 

请问这个问题应该怎么解决呢!

你先更新 registry 。然后再重新运行这段代码试试。更新 registry 的代码如下:

import Pkg
Pkg.update()

我运行了这段代码还是不可以 :no_mouth:
import Pkg
Pkg.update()
Updating registry at C:\Users\DELL\.julia\registries\General
Updating git-repo https://github.com/JuliaRegistries/General.git
┌ Error: Some registries failed to update:
│ — C:\Users\DELL.julia\registries\General — failed to fetch from repo: failed to fetch from GitHub - JuliaRegistries/General: The official registry of general Julia packages, error: GitError(Code:ERROR, Class:OS, failed to send request: 与服务器的连接意外终止
│ )
└ @ Pkg.Registry C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.8\Pkg\src\Registry\Registry.jl:449
No Changes to C:\Users\DELL\.julia\environments\v1.8\Project.toml
No Changes to C:\Users\DELL\.julia\environments\v1.8\Manifest.toml
┌ Info: We haven’t cleaned this depot up for a bit, running Pkg.gc()…
└ @ Pkg C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.8\Pkg\src\Pkg.jl:719
Active manifest files: 2 found
Active artifact files: 95 found
Active scratchspaces: 6 found
Deleted no artifacts, repos, packages or scratchspaces

import Pkg; Pkg.add(“CairoMakie”)
Resolving package versions…
No Changes to C:\Users\DELL\.julia\environments\v1.8\Project.toml
No Changes to C:\Users\DELL\.julia\environments\v1.8\Manifest.toml

using CairoMakie
CairoMakie.activate!()
┌ Info: Precompiling CairoMakie [13f3f980-e62b-5c42-98c6-ff1f3baf88f0]
└ @ Base loading.jl:1662
ERROR: LoadError: InitError: could not load library “C:\Users\DELL.julia\artifacts\f9f799e6ae3fe7f244bb55052db7ff1cea876c27\bin\libgettextlib-0-21.dll”
The specified module could not be found.
Stacktrace:

你可能需要重新设置环境变量JULIA_PKG_SERVER,并删除默认注册表 General再重新拉取。命令如下:

  1. 删除当前注册表:(@v1.4) pkg> registry rm General
  2. 从镜像站下载/拉取注册表: (@v1.4) pkg> registry add General

具体可以参考 julia | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

1 个赞

我全部卸载重新安装了一遍,还是不行。
import Pkg;
Pkg.add(“CarioMakie”)

Installing known registries into D:\Julia-1.8.2\juliaPKG
The following package names could not be resolved:

  • CarioMakie (not found in project, manifest or registry)
    Suggestions: StaticUnivariatePolynomials StochasticGroundMotionSimulation

import Pkg;
Pkg.add(“CarioMakie”)

Warning: could not download https:// https://mirrors.bfsu.edu.cn/julia/registries │ exception = Downloads.RequestError("https:// https://mirrors.bfsu.edu.cn/julia/registries", 3, “URL using bad/illegal format or missing URL”, Downloads.Response(nothing, "https:// https://mirrors.bfsu.edu.cn/julia/registries", 0, “”, Pair{String, String})) └ @ Pkg.Registry C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.8\Pkg\src\Registry\Registry.jl:68 Updating registry at D:\Julia-1.8.2\juliaPKG\registries\General.toml

The following package names could not be resolved: * CarioMakie (not found in project, manifest or registry) Suggestions: StaticUnivariatePolynomials StochasticGroundMotionSimulation

从报错来看,还是registry注册表的问题。换一个镜像站再重新拉取注册表试试?

我试了那几个在cmd窗口改的都不行,最后直接在scrips那个文件直接改的就可以啦