美文网首页
macOS 换源 conda pip

macOS 换源 conda pip

作者: AeroZ | 来源:发表于2020-07-29 16:09 被阅读0次

https://blog.csdn.net/fenghaodaxia/article/details/104520248
https://blog.csdn.net/R18830287035/article/details/90633942
https://blog.csdn.net/Awt_FuDongLai/article/details/105878916

一、pip 修改为清华镜像源

① 打开终端,输入 cd ~/.pip/ ;如果没有 .pip 文件夹,就新建: mkdir .pip
② cd .pip
③ nano pip.conf
④ 粘贴如下内容(清华镜像源),粘贴后保存,退出即可完成。你可以再打开终端依次输入②和③检查有没有粘贴成功。

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=pypi.tuna.tsinghua.edu.cn

【备注】 .pip文件路径为 /Users/你的账户名/ .pip。按shift+command+ . 就能看到这些隐藏文件了,再按一次就能恢复隐藏。

Alibaba
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
Douban
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com

二、conda 修改为清华镜像源

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 --set show_channel_urls yes
中科大
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

三、homebrew 修改为清华镜像源

① 打开终端,输入下面这一行,会自动生成文件名为 brew_install的文件(文件路径为 /Users/你的账户名/brew_install )

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install

② 右键点击brew_install,打开方式选择 “文本编辑.app”。打开后如图所示,加 # 号注释掉原来的源,再把下面这一行复制粘贴进去即可,保存后关闭文件。

BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git".freeze

相关文章

网友评论

      本文标题:macOS 换源 conda pip

      本文链接:https://www.haomeiwen.com/subject/tszhrktx.html