Ubuntu+Miniconda+Python 安装配置环境

部署运行你感兴趣的模型镜像

参考:

Ubuntu20+Miniconda3+Python3 安装配置环境(手动添加环境变量,更换清华源)_ubuntu miniconda添加环境变量-优快云博客

Index of /anaconda/miniconda/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror 

Index of /anaconda/archive/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror 

Windows 11 搭建GPU版本PyTorch环境详细过程-优快云博客

Start Locally | PyTorch

安装Miniconda:



Miniconda3 will now be installed into this location:
/root/miniconda3


Miniconda3 will now be installed into this location:
/root/miniconda3

-----------------------------------------------------------------------------------
Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you'd prefer that conda's base environment not be activated on startup,
   run the following command when conda is activated:

conda config --set auto_activate_base false

You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>> yes
no change     /root/miniconda3/condabin/conda
no change     /root/miniconda3/bin/conda
no change     /root/miniconda3/bin/conda-env
no change     /root/miniconda3/bin/activate
no change     /root/miniconda3/bin/deactivate
no change     /root/miniconda3/etc/profile.d/conda.sh
no change     /root/miniconda3/etc/fish/conf.d/conda.fish
no change     /root/miniconda3/shell/condabin/Conda.psm1
no change     /root/miniconda3/shell/condabin/conda-hook.ps1
no change     /root/miniconda3/lib/python3.12/site-packages/xontrib/conda.xsh
no change     /root/miniconda3/etc/profile.d/conda.csh
modified      /root/.bashrc

==> For changes to take effect, close and re-open your current shell. <==

Thank you for installing Miniconda3!



重启bash并测试:

安装pytorch + cuda:

conda create -n sd python=3.10

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.

验证pytorch环境:

import torch
torch.cuda.is_available()

安装jupyter notebook:

/root/miniconda3/envs/sd/bin/pip3 install jupyter -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

启动jupyter notebook

jupyter notebook --allow-root

您可能感兴趣的与本文相关的镜像

Python3.9

Python3.9

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值