ORCA包的安装(Windows, V1.4)

本人尝试安装ORCA的步骤

]add ORCA 只是下载了ORCA以及依赖的Conda 包到 .julia/packages中,此时的包尚不能使用。
build时会运行包中的build.jl文件,如果build失败,可查看该包的build.jl文件,查看发生了什么。
在]build ORCA 时发生以下过程:

1. 安装conda

Using Conda, 此时会运行conda包中conda.jl , 该文件主要作用是

1.下载miniconda3并安装,默认会从https://www.continuum.io/miniconda 下载,该包约50M,该步会限速,可能会time out。

解决办法:修改Conda.jl

修改.julia/packages/Conda/…/src/Conda.jl, 找到function _installer_url()函数的定义,将

res= ''https://www.continuum.io/miniconda$(MINICONDA_VERSION)-latest-"

改为清华镜像下载。

res = “https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda$(MINICONDA_VERSION)-latest-

2.打包了一些函数。如 Conda.add_channel, 相当于在anacoanda prompt中的命令“conda config --add channels”, Cona.add(‘Plotly-orca’,env) 相当于在env环境中添加‘’plotly-orca‘包。

2. conda creat _ORCA_jl_ 并安装plotly-orca

接下来会使用已经安装的conda创建_ORCA_jl_ 虚拟python环境。

可通过conda env list 查看,也可在 …/conda/env下看到。

然后在该环境下安装 plotly-orca包,该包约60M, 如果从默认channel中下载,会失败。

解决办法:在anaconda prompt中添加plotly channel 等。

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/plotly/
#会从该channel下载plotly-orca包。

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

上述设置后仍build错误,逐步运行orca的build.jl发现是Conda.add_channel等步骤错误。但提示可以在_ORCA_jl_中安装相应的包。

接下来在_ORCA_jl_ 环境中安装相应的包。打开anaconda prompt

conda env list   #查看虚拟环境列表
activate _ORCA_jl_  #激活该虚拟环境
conda install plotly  
conda install plotly-orca

运行后,因为已经在该虚拟环境下安装了plotly和plotly-orca,因此可以注释掉 ORCA包的build.jl中的部分语句。

3.指定orca.exe位置

重启julia,然后]build ORCA 成功,此时主要作用是新建一个paths.jl 文件,该文件指定了orca.exe的位置。

]test ORCA 通过。

4.如果已经在别处安装了conda(未测试)

可以考虑新建个虚拟环境_ORCA_jl_,在该虚拟环境中安装plotly和plotly-orca.

然后在ORCA/…/deps/paths.jl 中指定

const orca_cmd = `"conda目录\3\envs\_ORCA_jl_\orca_app\orca.exe"`

并删除ORCA/…/deps/的build.jl文件。

1 个赞