赞
踩
conda create --name pytorch112_py38 python=3.8.18
conda activate pytorch112_py38
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch
conda create --name pytorch22_py310 python=3.10.12
conda activate pytorch22_py310
conda install pytorch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 pytorch-cuda=11.8 -c pytorch -c nvidia
conda deactivate
conda create --name env --clone pytorch112_py38
conda env list
conda activate env
conda remove --name env sqlite
conda deactivate
conda remove --name env --all
PS C:\Users\lenovo> conda init --help
usage: conda-script.py init [-h] [--all] [--reverse] [--anaconda-prompt]
[--json] [-v] [-q] [-d] [shells ...]
Initialize conda for shell interaction. [Experimental]
Options:
positional arguments:
shells One or more shells to be initialized. If not given,
the default value is 'bash' on unix and 'cmd.exe' on Windows.
Use the '--all' flag to initialize all shells.
Currently compatible shells are {bash, cmd.exe, fish, powershell, tcsh, xonsh, zsh}
PS C:\Users\lenovo> conda init powershell
no change C:\Users\lenovo\miniconda3\Scripts\conda.exe
no change C:\Users\lenovo\miniconda3\Scripts\conda-env.exe
no change C:\Users\lenovo\miniconda3\Scripts\conda-script.py
no change C:\Users\lenovo\miniconda3\Scripts\conda-env-script.py
......
. : 无法加载文件 C:\Users\lenovo\Documents\WindowsPowerShell\profile.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 3
+ . 'C:\Users\lenovo\Documents\WindowsPowerShell\profile.ps1'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
// 通过Get-ExecutionPolicy可发现是受限的
PS C:\Users\lenovo> Get-ExecutionPolicy
Restricted
PS C:\WINDOWS\system32> Set-ExecutionPolicy RemoteSigned
执行策略更改
执行策略可帮助你防止执行不信任的脚本。更改执行策略可能会产生安全风险,如
https:/go.microsoft.com/fwlink/?LinkID=135170
中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略?
[Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暂停(S) [?] 帮助 (默认值为“N”): Y
(base) PS C:\Users\lenovo> conda list
# packages in environment at C:\Users\lenovo\miniconda3:
#
# Name Version Build Channel
......
conda info active environment : kan-tts active env location : /home/huangzhuofei/miniconda3/envs/kan-tts shell level : 2 user config file : /home/huangzhuofei/.condarc populated config files : /home/huangzhuofei/.condarc conda version : 23.9.0 conda-build version : not installed python version : 3.11.5.final.0 virtual packages : __archspec=1=x86_64 __cuda=12.0=0 __glibc=2.27=0 __linux=5.4.0=0 __unix=0=0 base environment : /home/huangzhuofei/miniconda3 (writable) conda av data dir : /home/huangzhuofei/miniconda3/etc/conda conda av metadata url : None channel URLs : https://mirrors.bfsu.edu.cn/anaconda/pkgs/main/linux-64 https://mirrors.bfsu.edu.cn/anaconda/pkgs/main/noarch https://mirrors.bfsu.edu.cn/anaconda/pkgs/r/linux-64 https://mirrors.bfsu.edu.cn/anaconda/pkgs/r/noarch https://mirrors.bfsu.edu.cn/anaconda/pkgs/msys2/linux-64 https://mirrors.bfsu.edu.cn/anaconda/pkgs/msys2/noarch package cache : /home/huangzhuofei/miniconda3/pkgs /home/huangzhuofei/.conda/pkgs envs directories : /home/huangzhuofei/miniconda3/envs /home/huangzhuofei/.conda/envs platform : linux-64 user-agent : conda/23.9.0 requests/2.31.0 CPython/3.11.5 Linux/5.4.0-150-generic ubuntu/18.04.6 glibc/2.27 UID:GID : 1006:1006 netrc file : None offline mode : False
environment.yaml
conda activate kan-tts
(kan-tts) conda env export --file environment.yaml --no-builds
environment.yaml
创建环境,创建的环境名和environment.yaml
里的name字段一致,可以用--name
指定新的环境名conda env create --file environment.yaml --name new_env_name
environment.yaml
更新现有环境,此时现有环境需要和environment.yaml
里的name字段一致,否则要用--name
conda env update --file environment.yaml --name cur_env_name
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。