1. 安装anaconda,使用anaconda install 时报错:Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
终端键入:
# 更新conda
conda update -n base conda
conda update -all
# 修改频道
conda config --add channels conda-forge
conda config --set channel_priority flexible
# 安装成功!
2. 在mac安装pygmt
pygmt官网 Installing — PyGMThttps://www.pygmt.org/dev/install.html
3. via anaconda在pygmt环境下conda install ipykernel,将该路径添加到notebook
python -m ipykernel install --user --name pygmt # install virtual environment properly
jupyter kernelspec list --json
使用obspy时,conda activate obspy; jupyter-lab;
使用pygmt时,conda activate pygmt; jupyter-lab;
安装完nb_conda之后(且安装失败),无法启动jupyter-lab:
#检查不同环境下的jupyter base环境
(base) szx@shizhuoandemini ~ % jupyter --path
config:
/Users/szx/.jupyter
/Users/szx/.local/etc/jupyter
/Users/szx/opt/anaconda3/etc/jupyter
/usr/local/etc/jupyter
/etc/jupyter
data:
/Users/szx/Library/Jupyter
/Users/szx/.local/share/jupyter
/Users/szx/opt/anaconda3/share/jupyter
/usr/local/share/jupyter
/usr/share/jupyter
runtime:
/Users/szx/Library/Jupyter/runtime
#obspy环境
(obspy) szx@shizhuoandemini ~ % jupyter --path
config:
/Users/szx/opt/anaconda3/envs/obspy/etc/jupyter
/Users/szx/.jupyter
/Users/szx/.local/etc/jupyter
/usr/local/etc/jupyter
/etc/jupyter
data:
/Users/szx/opt/anaconda3/envs/obspy/share/jupyter
/Users/szx/Library/Jupyter
/Users/szx/.local/share/jupyter
/usr/local/share/jupyter
/usr/share/jupyter
runtime:
/Users/szx/Library/Jupyter/runtime
#分别编辑以最长路径中的jupyter_config.json文件 删除"kernel_spec_manager_class': "nb_conda_kernels.CondaKernelSpecManager"后保存文件
重启环境及jupyter-lab
Julia集Ijulia配置:
1. 在mac安装julia
前往官网下载苹果系统的Julia程序包,进行安装;
输入以下代码以在终端使用Julia:
sudo mkdir -p /usr/local/bin
sudo rm -f /usr/local/bin/julia
sudo ln -s /Applications/Julia-1.9.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia
2. 配置julia下载源
查看版本信息versioninfo()
julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 8 × Apple M2
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
Threads: 1 on 4 virtual cores
在julia的startup.jl文件中直接输入以下信息,以更换源为ustc
文件地址:/Applications/Julia-1.9.app/Contents/Resources/julia/etc/julia/startup.jl
ubuntu中startup.jl文件地址:/opt/julia-1.6.7/etc/julia/startup.jl
# ~/.julia/config/startup.jl
ENV["JULIA_PKG_SERVER"] = "https://mirrors.ustc.edu.cn/julia"
3. Install Ijulia
using Pkg
Pkg.add("IJulia")
##在notebook中创建新脚本,如果可以创建Julia脚本则成功
using IJulia
notebook()