conda常用命令

conda list -----查看环境安装的所有包

conda install package_name----安装包  conda install numpy       conda install numpy==1.10

conda remove---卸载包

conda update package_name----更新包 例:coanda update --all ---更新所有包

activate my_env ------进入环境

deactivate-----------离开环境

conda env list ----创建的环境列表

conda env remove -n env_name ----- 删除指定环境

conda clean -a -----清楚pkgs中无用的安装包

conda create -n your_env_name python=X.X ----创建虚拟环境

conda config --show channels  查看conda的源

conda info --envs  -----打印创建的环境

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python  -----解决pip安装慢的问题,指定清华镜像

conda create -n BBB --clone AAA   ----有一个AAA的环境,创建一个新环境BBB跟它一模一样

pip install tensorflow==2.0.0 --index-url https://pypi.tuna.tsinghua.edu.cn/simple

useradd -r -m -s /bin/bash user_name
passwd user_name
新开账户登录之后:(校外使用需要连接上学校的VPN,校内不需要)
1、下载anaconda:  wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
2、安装anaconda: bash  Anaconda3-2020.02-Linux-x86_64.sh .安装过程中全程点击回车键,遇到需要输入的地方,全部输入“yes”。
3、运行:source ~/.bashrc  。这一步是激活anaconda设置的环境变量。
4、之后就可以用conda命令配置自己的需要的环境了

#### linux pip换源

mkdir ~/.pip

cd .pip

vim pip.conf

添加:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

Linux下

将以上配置文件写在~/.condarc
vim ~/.condarc

channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

Windows下永久换源:

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值