安装 conda & R 4.0.3 & Python 3.6

本文介绍如何使用Conda快速配置R 4.0.3和Python 3.6环境,包括Conda的安装、配置、包管理和环境管理等步骤,并提供了常见问题的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


快速配置 R 4.0.3 环境,请参考:1.1, 1.2 和 2.
快速配置 Python 3.6 环境,请参考:1.1, 1.2 和 3.

1. 安装 conda

1.1 安装

# 下载
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda2-latest-Linux-x86_64.sh

如果集群上已经安装过python,安装miniconda2(conda+python2)时可能会遇到以下报错信息:

sh Miniconda2-latest-Linux-x86_64.sh
:'
... ...
WARNING:
    You currently have a PYTHONPATH environment variable set. This may cause
    unexpected behavior when running the Python interpreter in Miniconda2.
    For best results, please verify that your PYTHONPATH only points to
    directories of packages that are compatible with the Python interpreter
    in Miniconda2: /path/miniconda2
Do you wish the installer to initialize Miniconda2
by running conda init? [yes|no]
[no] >>> yes
Traceback (most recent call last):
  File "/path/miniconda2/bin/conda", line 12, in <module>
    from conda.cli import main
ImportError: No module named conda.cli
... ...
'

解决方法如下:

# 防止环境变量冲突
unset PYTHONPATH
unset PYTHONHOME
# 安装
sh Miniconda2-latest-Linux-x86_64.sh

1.2 配置和升级

# 添加channel以提高下载速度
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
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/bioconda
# 升级
conda upgrade --all

#其它用法(可选)
conda config --show channels #查看源
conda config --add channels <channels> #添加源
conda config --remove channels <channels> #移除源
conda config --set show_channel_urls yes #安装包时显示channel url
#此外还可以通过修改.condarc文件查看、添加或移除源

1.3 包管理

conda list                      #查看已安装包
conda  search search_term      #搜索包信息
conda install <package_name>  #安装包
conda remove <package_name>  #卸载包
conda update <package_name> #更新包

1.4 环境管理

conda env list #查看已有环境
conda create -n <env_name> (<packages>) #创建环境
source activate <env_name>              #激活环境
source deactivate                       #退出环境
conda env remove -n <env_name> #删除环境
conda env export > env.yaml
conda env create -f env.yaml

2. 安装R 4.0.3

conda create -n r4
source activate r4
conda install r-base=4.0.3
source deactivate

3. 安装Python 3.6

conda create -n py3 python=3.6
conda activate py3
(E:\VSCodeVenv\hovernet) E:\VSCodeProjects\hovernet-honernet111\pip_cache_new&gt;conda install pytorch1.6.0 torchvision0.7.0 cudatoolkit=10.2 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch 3 channel Terms of Service accepted Retrieving notices: done Channels: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main defaults Platform: win-64 Collecting package metadata (repodata.json): done Solving environment: failed LibMambaUnsatisfiableError: Encountered problems while solving: package torchvision-0.7.0-py36_cu101 requires cudatoolkit &gt;=10.1,&lt;10.2, but none of the providers can be installed Could not solve for environment specs The following packages are incompatible ├─ cudatoolkit =10.2 * is requested and can be installed; ├─ openslide =* * is installable and it requires │ ├─ cairo &gt;=1.18.4,&lt;2.0a0 *, which requires │ │ ├─ fontconfig &gt;=2.15.0,&lt;3.0a0 * with the potential options │ │ │ ├─ fontconfig 2.15.0 would require │ │ │ │ └─ freetype &gt;=2.12.1,&lt;3.0a0 * with the potential options │ │ │ │ ├─ freetype [2.12.1|2.13.3], which can be installed; │ │ │ │ └─ freetype 2.13.3 would require │ │ │ │ └─ libfreetype6 ==2.13.3 h0b5ce68_1, which requires │ │ │ │ └─ freetype &gt;=2.13.3 *, which can be installed; │ │ │ └─ fontconfig 2.15.0 would require │ │ │ ├─ freetype &gt;=2.12.1,&lt;3.0a0 * with the potential options │ │ │ │ ├─ freetype [2.12.1|2.13.3], which can be installed; │ │ │ │ └─ freetype 2.13.3, which can be installed (as previously explained); │ │ │ └─ vc &gt;=14.2,&lt;15 *, which can be installed; │ │ ├─ freetype &gt;=2.12.1,&lt;3.0a0 * with the potential options │ │ │ ├─ freetype [2.12.1|2.13.3], which can be installed; │ │ │ └─ freetype 2.13.3, which can be installed (as previously explained); │ │ └─ libglib &gt;=2.82.2,&lt;3.0a0 *, which requires │ │ └─ pcre2 [&gt;=10.42,&lt;10.43.0a0 *|&gt;=10.44,&lt;10.45.0a0 *|&gt;=10.45,&lt;10.46.0a0 *], which requires │ │ └─ bzip2 &gt;=1.0.8,&lt;2.0a0 *, which can be installed; │ ├─ gdk-pixbuf &gt;=2.42.12,&lt;3.0a0 * with the potential options │ │ ├─ gdk-pixbuf 2.42.12 would require │ │ │ └─ libtiff &gt;=4.6.0,&lt;4.8.0a0 * with the potential options │ │ │ ├─ libtiff [4.6.0|4.7.0] would require │ │ │ │ └─ lerc &gt;=4.0.0,&lt;5.0a0 * with the potential options │ │ │ │ ├─ lerc 4.0.0, which can be installed; │ │ │ │ └─ lerc 4.0.0 would require │ │ │ │ └─ vc &gt;=14.2,&lt;15.0a0 *, which can be installed; │ │ │ └─ libtiff 4.7.0 conflicts with any installable versions previously reported; │ │ └─ gdk-pixbuf 2.42.12 would require │ │ ├─ libjpeg-turbo &gt;=3.1.0,&lt;4.0a0 *, which requires │ │ │ └─ jpeg &lt;0.0.0a *, which can be installed; │ │ ├─ libtiff &gt;=4.7.0,&lt;4.8.0a0 * with the potential options │ │ │ ├─ libtiff [4.6.0|4.7.0], which can be installed (as previously explained); │ │ │ └─ libtiff 4.7.0 conflicts with any installable versions previously reported; │ │ └─ vc &gt;=14.3,&lt;15 *, which can be installed; │ ├─ libglib &gt;=2.84.3,&lt;3.0a0 , which can be installed (as previously explained); │ ├─ libjpeg-turbo &gt;=3.1.0,&lt;4.0a0 , which can be installed (as previously explained); │ └─ libtiff &gt;=4.7.0,&lt;4.8.0a0 * with the potential options │ ├─ libtiff [4.6.0|4.7.0], which can be installed (as previously explained); │ └─ libtiff 4.7.0 conflicts with any installable versions previously reported; ├─ pin on python 3.6. = * is installable and it requires │ └─ python =3.6 *, which can be installed; └─ torchvision ==0.7.0 * is not installable because there are no viable options ├─ torchvision 0.7.0 would require │ └─ cudatoolkit &gt;=10.1,&lt;10.2 *, which conflicts with any installable versions previously reported; ├─ torchvision 0.7.0 would require │ └─ pillow &gt;=4.1.1 * but there are no viable options │ ├─ pillow [10.0.0|10.0.1|&hellip;|9.5.0] would require │ │ └─ python &gt;=3.10,&lt;3.11.0a0 *, which conflicts with any installable versions previously reported; │ ├─ pillow [10.0.0|10.0.1|&hellip;|9.5.0] would require │ │ └─ python &gt;=3.11,&lt;3.12.0a0 *, which conflicts with any installable versions previously reported; │ ├─ pillow [10.0.0|10.0.1|&hellip;|9.5.0] would require │ │ └─ python &gt;=3.8,&lt;3.9.0a0 *, which conflicts with any installable versions previously reported; │ ├─ pillow [10.0.0|10.0.1|&hellip;|9.5.0] would require │ │ └─ python &gt;=3.9,&lt;3.10.0a0 *, which conflicts with any installable versions previously reported; │ ├─ pillow [10.0.1|10.1.0|&hellip;|11.3.0] would require │ │ └─ python [&gt;=3.12,&lt;3.13.0a0 *|&gt;=3.12.0rc3,&lt;3.13.0a0 *], which conflicts with any installable versions previously reported; │ ├─ pillow [10.4.0|11.0.0|11.1.0|11.2.1|11.3.0] would require │ │ └─ python [&gt;=3.13,&lt;3.14.0a0 *|&gt;=3.13.0rc2,&lt;3.14.0a0 *], which conflicts with any installable versions previously reported; │ ├─ pillow [4.1.1|4.2.0|&hellip;|6.2.1] would require │ │ └─ python [=2.7 *|&gt;=2.7,&lt;2.8.0a0 *], which conflicts with any installable versions previously reported; │ ├─ pillow [4.1.1|4.2.0|&hellip;|5.3.0] would require │ │ └─ python [=3.5 *|&gt;=3.5,&lt;3.6.0a0 *], which conflicts with any installable versions previously reported; │ ├─ pillow [4.1.1|4.2.0|4.2.1] would require │ │ ├─ freetype ==2.7|=2.7 *, which conflicts with any installable versions previously reported; │ │ ├─ jpeg =9 *, which conflicts with any installable versions previously reported; │ │ └─ libtiff =4.0 *, which can be installed; │ ├─ pillow [4.2.1|4.3.0] would require │ │ ├─ freetype ==2.7 *, which conflicts with any installable versions previously reported; │ │ ├─ jpeg =9 *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.0.3,&lt;4.0.8 *, which can be installed; │ ├─ pillow [4.3.0|5.0.0] would require │ │ ├─ freetype =2.8 *, which conflicts with any installable versions previously reported; │ │ ├─ jpeg =9 *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.0.8,&lt;4.0.10 *, which can be installed; │ ├─ pillow [5.1.0|5.2.0] would require │ │ ├─ freetype [=2.8.1 *|==2.8.1 *], which conflicts with any installable versions previously reported; │ │ ├─ jpeg =9 *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.0.8,&lt;4.0.10 *, which can be installed; │ ├─ pillow 5.2.0 would require │ │ ├─ freetype &gt;=2.8.1,&lt;2.9.0a0 *, which conflicts with any installable versions previously reported; │ │ ├─ jpeg &gt;=9c,&lt;10a *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.0.9,&lt;4.4.0a0 * with the potential options │ │ ├─ libtiff 4.3.0 would require │ │ │ └─ lerc &gt;=2.2.1,&lt;3.0a0 *, which conflicts with any installable versions previously reported; │ │ ├─ libtiff 4.3.0 would require │ │ │ └─ lerc &gt;=3.0,&lt;4.0a0 *, which conflicts with any installable versions previously reported; │ │ ├─ libtiff 4.0.10, which can be installed; │ │ ├─ libtiff 4.0.9, which can be installed; │ │ ├─ libtiff 4.1.0, which can be installed; │ │ └─ libtiff 4.2.0, which can be installed; │ ├─ pillow [5.2.0|5.3.0|&hellip;|6.1.0] would require │ │ ├─ jpeg &gt;=9c,&lt;10a *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.0.9,&lt;4.4.0a0 * with the potential options │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.0.10, which can be installed; │ │ ├─ libtiff 4.0.9, which can be installed; │ │ ├─ libtiff 4.1.0, which can be installed; │ │ └─ libtiff 4.2.0, which can be installed; │ ├─ pillow [5.1.0|5.2.0|&hellip;|9.4.0] would require │ │ └─ python &gt;=3.7,&lt;3.8.0a0 *, which conflicts with any installable versions previously reported; │ ├─ pillow [6.1.0|6.2.0|&hellip;|7.1.2] would require │ │ ├─ jpeg &gt;=9c,&lt;10a *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.0.10,&lt;4.4.0a0 * with the potential options │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.0.10, which can be installed; │ │ ├─ libtiff 4.1.0, which can be installed; │ │ └─ libtiff 4.2.0, which can be installed; │ ├─ pillow [6.2.1|7.0.0|7.1.1|7.1.2] would require │ │ ├─ jpeg &gt;=9c,&lt;10a *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.1.0,&lt;4.4.0a0 * with the potential options │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.1.0, which can be installed; │ │ └─ libtiff 4.2.0, which can be installed; │ ├─ pillow [6.2.2|7.2.0|8.0.0|8.0.1|8.1.0] would require │ │ ├─ jpeg &gt;=9d,&lt;10a *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.1.0,&lt;4.4.0a0 * with the potential options │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.1.0, which can be installed; │ │ └─ libtiff 4.2.0, which can be installed; │ ├─ pillow [6.2.2|7.2.0|8.0.0|8.0.1|8.1.0] would require │ │ ├─ jpeg &gt;=9d,&lt;10a *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.0.10,&lt;4.4.0a0 * with the potential options │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.0.10, which can be installed; │ │ ├─ libtiff 4.1.0, which can be installed; │ │ └─ libtiff 4.2.0, which can be installed; │ ├─ pillow [8.1.0|8.1.1|8.1.2|8.2.0] would require │ │ ├─ jpeg &gt;=9d,&lt;10a *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.2.0,&lt;4.4.0a0 * with the potential options │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ └─ libtiff 4.2.0, which can be installed; │ ├─ pillow [8.3.0|8.3.1|8.3.2] would require │ │ ├─ jpeg &gt;=9d,&lt;10a *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.3.0,&lt;4.4.0a0 *, which cannot be installed (as previously explained); │ ├─ pillow [4.1.1|4.2.0|4.2.1] would require │ │ ├─ bzip2 ==1.0.6 * but there are no viable options │ │ │ ├─ bzip2 1.0.6 conflicts with any installable versions previously reported; │ │ │ └─ bzip2 1.0.6 would require │ │ │ └─ vc ==10 *, which conflicts with any installable versions previously reported; │ │ ├─ freetype =2.5 *, which conflicts with any installable versions previously reported; │ │ ├─ jpeg =9 *, which conflicts with any installable versions previously reported; │ │ └─ libtiff =4.0 *, which can be installed; │ ├─ pillow 4.2.1 would require │ │ ├─ freetype &gt;=2.8,&lt;2.9.0a0 *, which conflicts with any installable versions previously reported; │ │ ├─ jpeg &gt;=9b,&lt;10a *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.0.8,&lt;4.7.0 * with the potential options │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff [4.6.0|4.7.0], which can be installed (as previously explained); │ │ ├─ libtiff 4.0.10, which can be installed; │ │ ├─ libtiff 4.0.9, which can be installed; │ │ ├─ libtiff 4.1.0, which can be installed; │ │ ├─ libtiff 4.2.0, which can be installed; │ │ ├─ libtiff [4.4.0|4.5.0|4.5.1], which can be installed; │ │ └─ libtiff 4.0.8, which can be installed; │ ├─ pillow [4.3.0|5.0.0|5.1.0] would require │ │ ├─ freetype &gt;=2.8,&lt;2.9.0a0 *, which conflicts with any installable versions previously reported; │ │ ├─ jpeg &gt;=9b,&lt;10a *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.0.9,&lt;4.7.0 * with the potential options │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff [4.6.0|4.7.0], which can be installed (as previously explained); │ │ ├─ libtiff 4.0.10, which can be installed; │ │ ├─ libtiff 4.0.9, which can be installed; │ │ ├─ libtiff 4.1.0, which can be installed; │ │ ├─ libtiff 4.2.0, which can be installed; │ │ └─ libtiff [4.4.0|4.5.0|4.5.1], which can be installed; │ ├─ pillow [5.1.0|5.2.0|5.3.0|5.4.1] would require │ │ ├─ jpeg &gt;=9b,&lt;10a *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.0.9,&lt;4.7.0 * with the potential options │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff [4.6.0|4.7.0], which can be installed (as previously explained); │ │ ├─ libtiff 4.0.10, which can be installed; │ │ ├─ libtiff 4.0.9, which can be installed; │ │ ├─ libtiff 4.1.0, which can be installed; │ │ ├─ libtiff 4.2.0, which can be installed; │ │ └─ libtiff [4.4.0|4.5.0|4.5.1], which can be installed; │ ├─ pillow [6.0.0|6.1.0|6.2.0|6.2.1] would require │ │ ├─ jpeg &gt;=9b,&lt;10a *, which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.0.10,&lt;4.7.0 * with the potential options │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff [4.6.0|4.7.0], which can be installed (as previously explained); │ │ ├─ libtiff 4.0.10, which can be installed; │ │ ├─ libtiff 4.1.0, which can be installed; │ │ ├─ libtiff 4.2.0, which can be installed; │ │ └─ libtiff [4.4.0|4.5.0|4.5.1], which can be installed; │ ├─ pillow [7.0.0|7.1.2|7.2.0] would require │ │ ├─ jpeg &gt;=9b,&lt;10a , which conflicts with any installable versions previously reported; │ │ └─ libtiff &gt;=4.1.0,&lt;4.7.0 * with the potential options │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ │ ├─ libtiff [4.6.0|4.7.0], which can be installed (as previously explained); │ │ ├─ libtiff 4.1.0, which can be installed; │ │ ├─ libtiff 4.2.0, which can be installed; │ │ └─ libtiff [4.4.0|4.5.0|4.5.1], which can be installed; │ └─ pillow [8.0.0|8.0.1|&hellip;|8.3.1] would require │ ├─ jpeg = *, which conflicts with any installable versions previously reported; │ └─ libtiff &gt;=4.1.0,&lt;4.7.0 * with the potential options │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ ├─ libtiff 4.3.0, which cannot be installed (as previously explained); │ ├─ libtiff [4.6.0|4.7.0], which can be installed (as previously explained); │ ├─ libtiff 4.1.0, which can be installed; │ ├─ libtiff 4.2.0, which can be installed; │ └─ libtiff [4.4.0|4.5.0|4.5.1], which can be installed; ├─ torchvision 0.7.0 would require │ └─ python &gt;=3.7,&lt;3.8.0a0 *, which conflicts with any installable versions previously reported; └─ torchvision 0.7.0 would require └─ python &gt;=3.8,&lt;3.9.0a0 *, which conflicts with any installable versions previously reported. Pins seem to be involved in the conflict. Currently pinned specs: python=3.6安装过程中遇到了问题,请你仔细分析进程中的提示内容
最新发布
08-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值