服务器相关总结

文章目录

conda 安装

查看conda版本

bash 复制代码
conda --version

查看当前conda的配置文件位置

bash 复制代码
conda config --show

编辑配置文件,默认路径是~/condarc

bash 复制代码
vim ~/.condarc 

在channels字段添加新的镜像源,例如清华镜像

bash 复制代码
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
  - defaults

显示所有的channel

bash 复制代码
conda config --show channels

添加清华镜像源

bash 复制代码
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 --set show_channel_urls yes

镜像源总结(手动加)

bash 复制代码
-i https://pypi.tuna.tsinghua.edu.cn/simple

创建环境

bash 复制代码
创建名为 myenv 的新虚拟环境
conda create --name myenv

创建名为 myenv 的新虚拟环境,并指定 Python 版本为3.8
conda create --name myenv python=3.8

激活创建好的虚拟环境
conda activate myenv

安装pytorch

pytorch官网

bash 复制代码
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia

安装transformers

bash 复制代码
pip install transformers
pip install transformers==2.7.0
相关推荐
深色風信子17 分钟前
Docker newapi
运维·docker·容器·newapi
闫利朋2 小时前
Ubuntu 24.04 桌面安装向日葵完整指南
linux·运维·ubuntu
mfxcyh2 小时前
使用MobaXterm配置nginx
java·服务器·nginx
阿里巴巴首席技术官3 小时前
通过纯Nginx实现一个简单的文件上传功能
运维·nginx
pengyi8710153 小时前
动态IP池快速更换实操方案,5分钟完成IP替换
服务器·网络·tcp/ip
GL_Rain3 小时前
快速搭建Halo博客 + 崩溃秒恢复方案(Docker极简部署)
运维·docker·容器
不做无法实现的梦~3 小时前
Linux 上使用 CLion 开发嵌入式,并用 Codex CLI
linux·运维·服务器
被摘下的星星4 小时前
以太网技术
服务器·网络
卓豪终端管理5 小时前
两种终端数据清除策略的技术笔记:企业定向清除 vs 完全擦除
运维·自动化
lulukanshijie5 小时前
Packer 入门:自动化镜像构建工具
运维·其他·自动化