How to install and configure pytorch on Windows, and import it in pycharm (solved)

How to install and configure pytorch on Windows, and import it in pycharm (solved)

1. Due to the slow downloading of resources from the external network, you need to use the mirror image of Tsinghua University. You
need to find the .condarc file in "This computer-user-your personal directory" and write the following link

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - defaults
ssl_verify: true
show_channel_urls: true

2. After confirming that your computer driver and Anaconda are installed, enter it in cmd (PS: here is the 11.6 version I use)

conda install pytorch torchvision torchaudio cudatoolkit=11.6

Wait for the installation (you need to confirm the input y and press Enter during the period) to complete


3. After the installation is complete, you need to switch "settings-project mesindemo-python interpreter" in pycharm, click the gear and click add

Please add a picture description
Then
Please add a picture description
find your conda file and select the python.exe file as shown in the figure
Please add a picture description

Guess you like

Origin blog.csdn.net/m0_51581537/article/details/126276687