python安装插件国内镜像_python conda 安装和国内镜像加速

[TOC]

没开加速

CondaHTTPError: HTTP None None for url

Elapsed: None

An HTTP error occurred when trying to retrieve this URL.

SSLError(SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),),)

即使配置了 pip 国内镜像,仍然报错,肯定是网络问题

配置国内镜像

检查当前配置

conda config --show

默认还是使用 repo.continuum.io 的源

直接修改 ~/.condarc 配置文件

vim ~/.condarc

添加内容

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

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

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/

conda config --set show_channel_urls yes

channels:

- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

- defaults

show_channel_urls: true

default_channels:

- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

然后再用 conda config --show 复查配置

$ conda config --show

add_anaconda_token: True

add_pip_as_python_dependency: True

allow_softlinks: True

always_copy: False

always_softlink: False

always_yes: False

auto_update_conda: True

binstar_upload: None

changeps1: True

channel_alias: https://conda.anaconda.org

channel_priority: True

channels:

- defaults

client_ssl_cert:

client_ssl_cert_key:

create_default_packages: []

debug: False

default_channels:

- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

disallow: []

.....

删除源

conda config --remove-key $channels

安装 miniconda

macOS 安装Miniconda

安装 conda by brew

brew install brew-cask

brew cask info caskroom/cask/miniconda

brew cask install caskroom/cask/miniconda

.bash_profile

# caskroom/cask/miniconda

MINI_CONDA_BIN=~/miniconda3/bin/

export MINI_CONDA_BIN

export PATH=$PATH:$MINI_CONDA_BIN

注意:

使用conda list命令的环境时python版本切换到anaconda版本下,不然,无法使用

anaconda的环境下,也是只能使用系统pip命令安装插件包

Ubuntu 安装和卸载Anaconda 、Miniconda

# 安装

bash Miniconda3-latest-Linux-x86_64.sh

conda --version

conda list

卸载anaconda的步骤

rm -rf anaconda/文件夹名

# 清理下.bashrc中的Anaconda路径

# 关闭终端,然后再重启一个新的终端,这一步很重要,不然在原终端上还是绑定有anaconda

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值