【发布时间】:2022-01-21 12:38:54
【问题描述】:
我解压并复制到 julia-1.6.2 到 /opt/julia/
[root@srvr0 ~]# cp -a /root/Downloads/julia-1.6.2 /opt/julia/
/etc/profile.d/julia.sh 的内容:
export JULIA_HOME=/opt/julia/julia-1.6.2
export JULIA_LOAD_PATH=/opt/julia/julia-1.6.2/share/julia/stdlib/v1.6
export JULIA_DEPOT_PATH=/opt/julia/julia-1.6.2/share/julia/stdlib/v1.6
export JULIA_PKG_DEVDIR=/opt/julia/julia-1.6.2/share/julia/stdlib/v1.6
export JULIA_PROJECT=/opt/julia/julia-1.6.2/share/julia/stdlib/v1.6
export JULIA_HISTORY=/opt/julia/julia-1.6.2/share/julia/stdlib/v1.6/logs/repl_history.jl
设置环境变量:
[root@srvr0 ~]# source /etc/profile.d/julia.sh
调用朱莉娅:
[root@srvr0 ~]# julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.6.2 (2021-07-14)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
版本信息:
julia> versioninfo()
Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7 CPU M 620 @ 2.67GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, westmere)
Environment:
JULIA_DEPOT_PATH = /opt/julia/julia-1.6.2/share/julia/stdlib/v1.6
JULIA_PROJECT = /opt/julia/julia-1.6.2/share/julia/stdlib/v1.6
JULIA_LOAD_PATH = /opt/julia/julia-1.6.2/share/julia/stdlib/v1.6
JULIA_PKG_DEVDIR = /opt/julia/julia-1.6.2/share/julia/stdlib/v1.6
JULIA_HOME = /opt/julia/julia-1.6.2
JULIA_HISTORY = /opt/julia/julia-1.6.2/share/julia/stdlib/v1.6/logs/repl_history.jl
julia> import Pkg
julia> using Pkg
添加包 MbedTLS 但出现错误:
(v1.6) pkg> add MbedTLS
Installing known registries into `@stdlib/v1.6`
Added registry `General` to `/opt/julia/julia-1.6.2/share/julia/stdlib/v1.6/registries/General`
Resolving package versions...
Installed MbedTLS ─ v1.0.3
Updating `@stdlib/Project.toml`
[739be429] + MbedTLS v1.0.3
Updating `@stdlib/Manifest.toml`
[739be429] + MbedTLS v1.0.3
[56f22d72] + Artifacts
[ade2ca70] + Dates
[8f399da3] + Libdl
[de0858da] + Printf
[9a3f8284] + Random
[9e88b42a] + Serialization
[6462fe0b] + Sockets
[4ec0a83e] + Unicode
[c8ffd9c3] + MbedTLS_jll
Precompiling project...
✗ MbedTLS
0 dependencies successfully precompiled in 13 seconds
2 dependencies errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the packages
julia> using Pkg
ERROR: ArgumentError: Package Pkg not found in current path:
- Run `import Pkg; Pkg.add("Pkg")` to install the Pkg package.
Stacktrace:
[1] require(into::Module, mod::Symbol)
@ Base ./loading.jl:893
观察:在添加包 MbedTLS 之前,包 Pkg 在路径上,但在调用 add MbedTLS 后,我收到错误包 Pkg 在当前路径中找不到
请指导我安装 MbedTLS 包!
【问题讨论】:
-
为什么是 1.6.2?当前版本是 1.7.0,1.6 系列的最后一个版本是 1.6.4(1.6.5 和 1.7.1 即将发布)
-
可能升级并不容易(例如,由于某些公司规定等)。