当前位置:网站首页>anaconda中移除旧环境、增加新环境、查看环境、安装库、清理缓存等操作命令
anaconda中移除旧环境、增加新环境、查看环境、安装库、清理缓存等操作命令
2022-07-29 05:21:00 【机器不学习我学习】
1.移除旧环境
打开Anaconda Prompt
输入命令查看环境:
conda env list
or
conda info --envs
可以看到有2个主要环境,base和tensorflow
现在想要移除tensorflow环境
conda remove -n tensorflow --all
2.创建新环境
如果需要安装很多packages,你会发现conda下载的速度经常很慢,因为Anaconda.org的服务器在国外。所幸的是,清华TUNA镜像源有Anaconda仓库的镜像,我们将其加入conda的配置即可:
#添加Anaconda的TUNA镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
#TUNA的help中镜像地址加有引号,需要去掉
#设置搜索时显示通道地址
conda config --set show_channel_urls yes
配置好后:
#创建一个名为tf的3.6环境
#当然,当网络畅通的时候,上面步骤也可以忽略
conda create --name tf python=3.6 # 或者 conda create -n tf python=3.6
3.切换环境
activate tensorflow就可以切换到tensorflow环境下了【conda activate tensorflow】
4.安装库
pip 或者 conda
pip install numpy==1.12.0 安装指定版本
pip install numpy 默认安装最新版本
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -i https://mirrors.aliyun.com/pypi/simple/ tensorboard
使用清华镜像安装
conda install numpy
pip 国内源:
阿里云 :http://mirrors.aliyun.com/pypi/simple/
中国科技大学: https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) :http://pypi.douban.com/simple/
清华大学 :https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学: http://pypi.mirrors.ustc.edu.cn/simple/
conda 国内源:
# 查看当前源
conda config --show-sources
# 添加源
#conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ #清华源停服
# 腾讯云
conda config --add channels https://mirrors.cloud.tencent.com/anaconda/pkgs/free/
conda config --add channels https://mirrors.cloud.tencent.com/anaconda/pkgs/main/
conda config --set show_channel_urls yes
# 换回默认源
conda config --remove-key channels
5.清理anaconda缓存
conda clean -p # 删除没有用的包 --packages
conda clean -t # 删除tar打包 --tarballs
conda clean -y --all # 删除所有的安装包及cache(索引缓存、锁定文件、未使用过的包和tar包)
#---------------------------------------------------------------------------
windows下tensorflow:
numpy=1.15.1
tensorflow=1.10.0
skimage=0.15.0
base
numpy=1.14.3
skimage=0.13.1
更新库:
pip install upgrade+库的名字
更新时出现拒绝访问:
pip install --user --upgrade tensorflow-gpu
ermissionError: [WinError 5] 拒绝访问。解决办法
https://blog.csdn.net/weixin_43870646/article/details/90020874
pip install --user numpy==1.15.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
Ubuntu中直接输入spyder启动spyder
启动navigator:anaconda-navigator
#--------------------------------------------------------------------------#
opencv 3.4.0安装
pip install opencv-python==3.4.0.12 -i https://pypi.tuna.tsinghua.edu.cn/simple
#-------------------------------------------------------------------------#
打包依赖环境
pip freeze >> requirements.txt
#-------------------------------------------------------------------------#
pytorch离线包:
https://download.pytorch.org/whl/torch_stable.html
离线安装包下载地址:
http://mirrors.aliyun.com/pypi/simple/
安装第三方库,一定要注意:
python版本+依赖库版本(+CUDA版本)
边栏推荐
- Fantom (FTM) surged 45% before the FOMC meeting
- “山东大学移动互联网开发技术教学网站建设”项目实训日志一
- ReportingService WebService Form身份验证
- rsync+inotyfy实现数据单项监控实时同步
- mysql在查询字符串类型的时候带单引号和不带的区别和原因
- The bear market is slow, and bit.store provides stable stacking products to help you get through the bull and bear market
- XDFS&空天院HPC集群典型案例
- "Shandong University mobile Internet development technology teaching website construction" project training log V
- Research and implementation of flash loan DAPP
- How to obtain openid of wechat applet in uni app project
猜你喜欢
How to obtain openid of wechat applet in uni app project
Go|gin quickly use swagger
mysql插入百万数据(使用函数和存储过程)
Okaleido tiger logged into binance NFT on July 27, and has achieved good results in the first round
day02作业之进程管理
剑指核心-TaoCloud全闪SDS助力构建高性能云服务
Training log 6 of the project "construction of Shandong University mobile Internet development technology teaching website"
深度学习的趣味app简单优化(适合新手)
中海油集团,桌面云&网盘存储系统应用案例
Sports health is deeply rooted in the hearts of the people, and move protocol leads quality life
随机推荐
Gluster集群管理小分析
My ideal job, the absolute freedom of coder farmers is the most important - the pursuit of entrepreneurship in the future
识变!应变!求变!
Super simple integration of HMS ml kit to realize parent control
Training log II of the project "construction of Shandong University mobile Internet development technology teaching website"
Tear the ORM framework by hand (generic + annotation + reflection)
The bear market is slow, and bit.store provides stable stacking products to help you get through the bull and bear market
Training log III of "Shandong University mobile Internet development technology teaching website construction" project
ssm整合
深入理解MMAP原理,让大厂都爱不释手的技术
centos7 静默安装oracle
D3.JS 纵向关系图(加箭头,连接线文字描述)
Huawei 2020 school recruitment written test programming questions read this article is enough (Part 2)
Fantom (FTM) prices will soar by 20% in the next few days
Crypto giants all in metauniverse, and platofarm may break through
Okaleido tiger logged into binance NFT on July 27, and has achieved good results in the first round
Centos7 silently installs Oracle
[go] use of defer
Breaking through the hardware bottleneck (I): the development of Intel Architecture and bottleneck mining
rsync+inotyfy实现数据单项监控实时同步