conda相关操作

安装torch

直接使用conda install torch==1.12.0会报错,因为 Conda 通常使用 pytorch 作为包名(而非 torch)
正确使用方法:

bash 复制代码
conda install pytorch==1.12.0 -c pytorch

使用 pip 安装

bash 复制代码
pip install torch==1.12.0

在 Conda 中查看可安装的 PyTorch 版本,可以通过以下几种方法实现:

  • 使用 conda search 查询
bash 复制代码
conda search pytorch -c pytorch
  • 或指定更多渠道:
bash 复制代码
conda search pytorch -c pytorch -c conda-forge
# 例如:conda search pytorch -c pytorch -c pytorch

查看已安装版本

bash 复制代码
python -c "import torch; print(torch.__version__)"
相关推荐
阳懿1 天前
【已解决】执行conda init提示No action taken.
conda
try2find1 天前
移动conda虚拟环境的安装目录
linux·运维·conda
起个名好难00003 天前
conda 常用指令
conda
Mark White3 天前
把大象塞进冰箱总共分几步:讲讲dockerfile里conda的移植
conda
巴里巴气3 天前
2025.1版本PyCharam找不到已存在的conda虚拟环境
pycharm·conda
互联网搬砖老肖3 天前
Python 中如何使用 Conda 管理版本和创建 Django 项目
python·django·conda
茫茫人海一粒沙14 天前
Python 包管理新选择:全面了解 uv(附 Conda 对比)
python·conda·uv
Sim time15 天前
用AI从0开始量化交易-Anaconda环境(env)和缓存(pkg)更改储存位置
人工智能·python·conda
追光天使15 天前
CondaError: Run ‘conda init‘ before ‘conda activate
conda
l1o3v1e4ding16 天前
conda(Anaconda/Miniconda)常用命令
conda