先新建一个环境
可以可视化创建
cmd里进入这个虚拟环境
(base) C:\Users\Administrator>conda env list
# conda environments:
#
base * D:\python\Anaconda3
GUIenv D:\python\Anaconda3\envs\GUIenv
myenv D:\python\Anaconda3\envs\myenv
python_code D:\python\Anaconda3\envs\python_code
torchenv D:\python\Anaconda3\envs\torchenv
(base) C:\Users\Administrator>activate torchenv(torchenv) C:\Users\Administrator>python
Python 3.6.11 (default, Aug 5 2020, 19:41:03) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z
安装pytorch、torchvision
conda install pytorch torchvision cpuonly -c pytorch
torchtext
pip install -i https://pypi.doubanio.com/simple/ torchtext
最后
检验安装成功