win+R打开“运行”,输入cmd
win+R打开“运行”, 输入powershell
(或右键“开始”图标,点击终端)
报错:无法加载文件profile.ps1
无法加载文件 D:\Users\Lenovo\Documents\WindowsPowerShell\profile.ps1,因为在此系统上禁止运行脚本。
无法加载文件 E:\Software\anaconda3\shell\condabin\Conda.psm1,因为在此系统上禁止运行脚本。
原因:在Windows系统中,默认情况下不允许执行.ps1文件
解决方法:
使用管理员权限打开终端,输入
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
可以使用Get-ExecutionPolicy确认是否修改成功
修改成功后
conda
conda -h
conda –-help
conda -V
conda –-version
conda env list
conda info -e
conda info --envs
conda activate robot
activate robot # cmd中可以省略conda
conda deactivate
conda clean -h
conda clean -p
conda clean -t
conda clean -y --all
conda compare -h
conda config –show
conda config --show-sources
conda config --remove channels + 要添加的源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --remove channels + 要删除的源
conda config --set show_channel_urls yes
conda config –add envs_dirs E:\Software\anaconda3\envs
conda create -h
①创建名为robot的python3.8虚拟环境
conda create --name robot python=3.8
①根据环境名
conda create -n robot1 --clone robot
②根据环境路径
conda create -p E:\Software\anaconda3\envs\ robot2 --clone robot
conda info
conda info -h
conda list
conda list -n robot # 根据名称
conda list -p E:\Software\anaconda3\envs\robot #根据路径
conda list ^p
conda list --export > requirements.txt
默认存储在如下位置:
conda create -n robot3 –-file=C:\Users\Lenovo\requirements.txt
conda remove --name robot1 --all
conda remove -n robot1 --all
rename
conda update conda
conda update anaconda
conda update spyder