condarc源镜像的更换/jupyter环境使用及本地源切换/镜像源网址

 

1.在conda中更换镜像方法(避免超时,无法创建虚拟环境):

  首先执行如下几条命令更换清华镜像源

  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/conda-forge/

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

  conda config --set show_channel_urls yes

  更改镜像源配置文件

  windows系统:在用户根目录(C:\Users\用户名)下找到.condarc文件,打开并并编辑,删除其中的default配置行。

  
     
     linux系统:使用vim ~/.condarc 方法添加,也可使用上面的命令添加。
 
 

2.jupyter中切换本地不同的虚拟环境

  a.切换至你的虚拟环境:  activate py36    (py36是我的虚拟环境名称)
  b.pip install ipykernel 安装必要插件
  c.python -m ipykernel install --name py36 将环境添加到Jyputer中 

3.jupyter notebook中删除虚拟环境

  jupyter kernelspec remove pyenv37

 4.利用其它镜像安装库

  pip install ipykernel      -i   https://pypi.tuna.tsinghua.edu.cn/simple some-package     安装必要插件       
  https://pypi.tuna.tsinghua.edu.cn/simple some-package 
  如果安装某个路径用:
  pip install numpy target=='c:/ADC'      -i   https://pypi.tuna.tsinghua.edu.cn/simple some-package     安装必要插件
  5.默认浏览器设置(添加:2022-09-15)
 1. conda中输入:  jupyter notebook --generate-config
2.找到路径jupyter_notebook_config.py路径,打开并添加如下代码:
import webbrowser
webbrowser.register('chrome', None, webbrowser.GenericBrowser(u'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'))
c.NotebookApp.browser = 'chrome'

 

6.其它源:
https://pypi.tuna.tsinghua.edu.cn/simple

清华:https://pypi.tuna.tsinghua.edu.cn/simple

阿里云:https://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

华中理工大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/ 

豆瓣:https://pypi.douban.com/simple/

 
requrements.txt 安装:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -U -r requirements.txt
 
 
类库网址:http://www.lfd.uci.edu/~gohlke/pythonlibs/#cython      如Cython
 
 
 
 
 
 
posted @ 2020-11-22 13:30  tangjunjun  阅读(1002)  评论(0编辑  收藏  举报
https://rpc.cnblogs.com/metaweblog/tangjunjun