conda添加源
#查看当前conda配置
conda config --show channels
#设置通道
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
#设置搜索是显示通道地址
conda config --set show_channel_urls yes
conda install pytorch torchvision cudatoolkit=10.0 # 删除安装命令最后的 -c pytorch,才会采用清华源安装。
查看配置信息
conda config --show
恢复默认源
conda config --remove-key channels
删除旧镜像源
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/
通过本地安装包安装
如果出现网络问题或者无法联网可以先在Anaconda的网站上下载安装包,然后通过--use-local
进行本地安装。
下载后, 到下载文件夹, 执行:
conda install --use-local rdkit-2018.09.2.0-py36h865188c_1.tar.bz2
成功后, 会在conda文件夹的pkgs
子文件夹出现相应压缩包以及解压后的文件夹.
这一步只是将包进行安装 (装到site-packages
), 可以在python进行import, 但发现, 实际上并没有完成依赖库的安装. 因此, 要继续运行:
conda install -c local rdkit
这里指明使用本地作为channel, 然后安装相关依赖包. 安装成功后, 再import试试? OK.