1 annoconda下载
文件地址列表,选择版本下载https://repo.anaconda.com/archive/ win10版本: Anaconda3-2023.03-1-Windows-x86_64
linux版本: Anaconda3-2023.03-1-Linux-x86_64
win10下执行exe按向导安装,linux下./Anaconda3-2023.03-1-Linux-x86_64.sh
2 conda常用命令配置
(1)显示当前的镜像源
conda config --show-sources
(2)设置搜索时显示检索地址
conda config --set show_channel_urls yes
(3)创建conda环境
conda create -n env_name python==3.9
(4)激活conda环境
conda activate env_name
(5)删除指定conda环境
conda remove -n env_name -all
3 添加新的镜像源,加速软件下载
(1)conda下安装pip
conda install pip
(2)添加清华镜像源:
conda config --add channels https://pypi.tuna.tsinghua.edu.cn/simple
还可以添加其他的几个镜像源:
#豆瓣源
conda config --add channels http://pypi.douban.com/simple/
# 阿里源
conda config --add channels https://mirrors.aliyun.com/pypi/simple/
#中科大源
conda config --add channels https://pypi.mirrors.ustc.edu.cn/simple/
(3)指定特定软件从特定的镜像源下载
pip install numpy -i https://mirrors.aliyun.com/pypi/simple/
(4)删除指定的镜像源
conda config --remove channels https://pypi.mirrors.ustc.edu.cn/simple/
4 遇到“UnavailableInvalidChannel: HTTP 404 NOT FOUND for channel”的问题解决
conda config --remove-key channels
执行完成后,继续执行conda命令,即可成功执行
5 如遇到权限问题,导致conda install失败,如下所示
^C
PS C:\Users\admin> conda install pip
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: D:\Anconda3
added / updated specs:
- pip
The following packages will be UPDATED:
certifi 2022.12.7-py310haa95532_0 --> 2023.5.7-py310haa95532_0
pip 22.3.1-py310haa95532_0 --> 23.0.1-py310haa95532_0
Proceed ([y]/n)? y
Downloading and Extracting Packages
Preparing transaction: done
Verifying transaction: failed
EnvironmentNotWritableError: The current user does not have write permissions to the target environment.
environment location: D:\Anconda3
此时,以管理员身份运行conda install即可成功