1.conda install
用conda安装软件的标准语法格式为:
conda install -c <channel> <software>
其中-c
这个参数用来指定软件下载的镜像位置。
不指定时为默认channel
2.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 --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --set show_channel_urls yes
切换回原来的镜像源。
conda config --remove-key channels
3.jupyter notebook扩展(nbextensions)
笔记本扩展(nbextensions)是一种JavaScript模块,可以加载到笔记本前端页面上,可以大大提升用户体验。
安装(需要在Anaconda Prompt内打开)
conda install jupyter_nbextensions_configurator
然后把Jupyter打开,就可以看到NBextensions选项卡了。
常用功能:
- Table of Contents(2)
形成目录栏 - Variable Inspector
显示所有构建的变量信息(变量名) - ExcecuteTime
计算每一个模块的时间,和运行结束时间
4 pip更新package
pip install --upgrade PackageName
5 pip清华源
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple package
5.1 pip设置时间
pip --timeout=100 install PackageName
5.2 pip豆瓣源(更推荐)
pip install PackageName -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
6 Anaconda管理的(安装的)包的位置
具体路径为 Anaconda\Lib\site-packages
7 conda
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/soumith/win-64/current_repodata.json>
Elapsed: -
删除.condarc里的- defaults
并添加清华源
参考https://blog.youkuaiyun.com/Copper01/article/details/97134974
8 使用requirements.txt文件安装package
tornado==5.1.1
mysql-connector-python==8.0.12
sqlalchemy==1.2.12
...
执行pip install -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com -r requirements.txt
9 看conda源下该包有哪些可用版本
conda search --full-name tensorflow