venv
來創造一個虛擬環境:python -m venv <YOUR-PATH>
venv
參數介紹:
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] [--upgrade]
[--without-pip] [--prompt PROMPT] ENV_DIR [ENV_DIR ...]
Creates virtual Python environments in one or more target directories.
positional arguments:
ENV_DIR A directory to create the environment in.
optional arguments:
-h, --help show this help message and exit
--system-site-packages
Give the virtual environment access to the system site-packages dir.
--symlinks Try to use symlinks rather than copies, when symlinks are
not the default for the platform.
--copies Try to use copies rather than symlinks, even when symlinks are
the default for the platform.
--clear Delete the contents of the environment directory if it already exists,
before environment creation.
--upgrade Upgrade the environment directory to use this version of Python,
assuming Python has been upgraded in-place.
--without-pip Skips installing or upgrading pip in the virtual environment (pip is bootstrapped by default)
--prompt PROMPT Provides an alternative prompt prefix for this environment.
Once an environment has been created, you may wish to activate it, e.g. by sourcing an activate script in its bin directory.
進入虛擬環境:
source <YOUR-PATH>/bin/activate
離開虛擬環境:
deactivate
可先寫好 requirements.txt
,直接打:
pip install -r requirements.txt
requirements.txt
寫法:
--find-links https://download.pytorch.org/whl/torch_stable.html
matplotlib
numpy
torch==1.10.0+cu113
torchvision==0.11.1+cu113
torchaudio===0.10.0+cu113
torchsummary
直接刪除資料夾即可:
rm <YOUR-VENV> -rf
pip packages
到 requirements.txt
pip freeze > requirements.txt
Conda 建立&管理 Python 虛擬環境 建立虛擬環境 步驟一: 確認自己現有環境 tienyi@tienyi:~$ conda env list output: # conda environments:
Feb 20, 2022PyTorch 使用 vgg16 訓練 Stanford Dog Datasets 實驗環境 Operating System Ubuntu 20.04.03 LTS (Focal Fossa) GPU Nvidia RTX 3080 Nvidia Driver Version
Nov 4, 2021Ubuntu 20.04 安裝 TenserFlow & PyTorch for RTX 30系列 將會安裝以下套件 TensorFlow PyTorch CUDA cuDNN Dependencies and other frameworks like Caffe and Theano(?) 系統需求
Nov 2, 2021or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up