当前位置:网站首页>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版本)
边栏推荐
- NIFI 改UTC时间为CST时间
- “山东大学移动互联网开发技术教学网站建设”项目实训日志三
- 超简单集成HMS ML Kit 实现parental control
- Rsync+inotyfy realize real-time synchronization of single data monitoring
- ANR优化:导致 OOM 崩溃及相对应的解决方案
- Print out all prime numbers between 1-100
- centos7 静默安装oracle
- Process management of day02 operation
- Training log 7 of the project "construction of Shandong University mobile Internet development technology teaching website"
- Basic use of array -- traverse the circular array to find the maximum value, minimum value, maximum subscript and minimum subscript of the array
猜你喜欢

Thinkphp6 pipeline mode pipeline use

深入理解MMAP原理,让大厂都爱不释手的技术

华为2020校招笔试编程题 看这篇就够了(上)

mysql 的show profiles 使用。

Dao race track is booming. What are the advantages of m-dao?

Training log III of "Shandong University mobile Internet development technology teaching website construction" project

Fantom (FTM) surged 45% before the FOMC meeting

Flink connector Oracle CDC 实时同步数据到MySQL(Oracle19c)

“山东大学移动互联网开发技术教学网站建设”项目实训日志四

手撕ORM 框架(泛型+注解+反射)
随机推荐
钉钉告警脚本
识变!应变!求变!
Lock lock of concurrent programming learning notes and its implementation basic usage of reentrantlock, reentrantreadwritelock and stampedlock
关于Flow的原理解析
Win10+opencv3.2+vs2015 configuration
Xsan is highly available - xdfs and San are integrated with new vitality
与张小姐的春夏秋冬(2)
Go|gin quickly use swagger
“山东大学移动互联网开发技术教学网站建设”项目实训日志四
简单聊聊 PendingIntent 与 Intent 的区别
微信小程序源码获取(附工具的下载)
Research on the implementation principle of reentrantlock in concurrent programming learning notes
Idea using JDBC to connect mysql database personal detailed tutorial
并发编程学习笔记 之 工具类CountDownLatch、CyclicBarrier详解
“山东大学移动互联网开发技术教学网站建设”项目实训日志六
Training log III of "Shandong University mobile Internet development technology teaching website construction" project
并发编程学习笔记 之 原子操作类AtomicInteger详解
Laravel service container (inheritance and events)
Crypto giants all in metauniverse, and platofarm may break through
The Platonic metauniverse advocated by musk has long been verified by platofarm