1 installed after a good editor that comes with spyder
2 Open Software
3 Every program needs to develop python version anaconda3 created a virtual environment corresponding path
For example, in my computer I created two environments
And my pytorch installed python3.6, and I need to specify the corresponding lib environment
F:\dongdong\0tool\python\anaconda3\envs\work_py36\Lib
Adding beginning of the program
SYS Import # actual library environment created sys.path.append ( "F: / dongdong / 0tool / python / anaconda3 / envs / work_py36 / Lib / site-packages")
Complete program
# - * - Coding: UTF-8 - * - Import SYS actual environment created library # sys.path.append ( "F: / dongdong / 0tool / Python / anaconda3 / Envs / work_py36 / Lib / Site-Packages Standard Package") Import Torch Print ( "--------------------------") array1 = torch.zeros (2,. 3) array2 = torch.rand (2, . 3) Print (array2 array1 +) Print ( "--------------------------")