当前位置:网站首页>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版本)
边栏推荐
- Laravel service container (Application of context binding)
- Madonna "hellent" bought $1.3 million NFT boring ape, which is now considered too expensive
- rsync+inotyfy实现数据单项监控实时同步
- asyncawait和promise的区别
- 超简单集成HMS ML Kit 实现parental control
- Detailed explanation of atomic operation classes atomicreference and atomicstampedreference in learning notes of concurrent programming
- Study and research the way of programming
- Activity交互问题,你确定都知道?
- Crypto giants all in metauniverse, and platofarm may break through
- "Shandong University mobile Internet development technology teaching website construction" project training log V
猜你喜欢

超简单集成HMS ML Kit 人脸检测实现可爱贴纸

Some opportunities for young people in rural brand building

Research on the implementation principle of reentrantlock in concurrent programming learning notes

The bear market is slow, and bit.store provides stable stacking products to help you get through the bull and bear market

Process management of day02 operation

与张小姐的春夏秋冬(3)

Shanzhai coin Shib has a US $548.6 million stake in eth whale's portfolio - traders should be on guard

Flink, the mainstream real-time stream processing computing framework, is the first experience.

centos7 静默安装oracle

“山东大学移动互联网开发技术教学网站建设”项目实训日志四
随机推荐
XDFS&空天院HPC集群典型案例
ReportingService WebService Form身份验证
Ribbon learning notes 1
NIFI 改UTC时间为CST时间
Basic use of array -- traverse the circular array to find the maximum value, minimum value, maximum subscript and minimum subscript of the array
闪贷Dapp的调研及实现
“山东大学移动互联网开发技术教学网站建设”项目实训日志三
How can Plato obtain premium income through elephant swap in a bear market?
Huawei 2020 school recruitment written test programming questions read this article is enough (Part 2)
“山东大学移动互联网开发技术教学网站建设”项目实训日志四
Training log 7 of the project "construction of Shandong University mobile Internet development technology teaching website"
Starfish OS: create a new paradigm of the meta universe with reality as the link
并发编程学习笔记 之 原子操作类AtomicInteger详解
Sports health is deeply rooted in the hearts of the people, and move protocol leads quality life
微信小程序源码获取(附工具的下载)
主流实时流处理计算框架Flink初体验。
asyncawait和promise的区别
【go】defer的使用
Detailed explanation of atomic operation classes atomicreference and atomicstampedreference in learning notes of concurrent programming
Android studio login registration - source code (connect to MySQL database)