conda常用指令
基础命令
查看所有虚拟环境
shell
$ conda env list
激活虚拟环境
shell
$ conda activate env_name
创建虚拟环境,可以指定python版本
shell
$ conda create -n envname python=3.9
删除虚拟环境
shell
$ conda remove -n envname --all
查看源
shell
$ conda config --show
查看环境中所有的包
shell
$ conda list
安装pytorch
首先查看目前驱动支持的最大CUDA版本,右上角CUDA Version即为答案
shell
$ nvidia-smi
在网页https://zhuanlan.zhihu.com/p/694038606查看PyTorch/Python/Cuda版本对应和和兼容性
在网页https://pytorch.org/get-started/locally/选择自己需要的版本,获取指令,如果需要获取老版本,点击上面的Previous PyTorch Version,不要换源不然好慢
shell
$ conda install pytorch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 pytorch-cuda=12.1 -c pytorch -c nvidia
安装torch_geometric库
shell
$ conda install pyg -c pyg
安装pandas库
shell
$ conda install pandas