Common Issues When Setting Up PyTorch Environment

1 Issues

1. Always stuck on solving environment and can’t get out. Network solutions include: configuring Tsinghua source, updating conda, etc., but nothing worked.2. After downloading, there are 3 things that need to be done, the last one starting with exe (maybe), always reports an error. Network solutions include: opening prompt with administrator privileges, etc., but nothing worked.3. Sometimes after configuring the source, when installing packages, it shows something like https; you can find the “.condarc” file in the user folder on the C drive and change all the URLs to start with http instead of https.4. The above problems keep recurring, so I gave up. I tried installing with pip, but a bunch of red text indicating failure appeared, saying files were not found, etc. I tried following Baidu’s results, but it didn’t work out, ultimately still failing.Common Issues When Setting Up PyTorch Environment

2 Methods Finally, I was really annoyed, so I uninstalled Anaconda, downloaded the latest version, and reconfigured the environment variables. I repeated the above steps, and this time it installed smoothly. (1) Check the local Python version (the local Python interpreter version is 3.8.5)Common Issues When Setting Up PyTorch Environment (2) Click to start Anaconda Prompt to create a new virtual environmentCommon Issues When Setting Up PyTorch Environment (3) In Anaconda Prompt, execute the following commands sequentially to create a virtual environment named pytorchCommon Issues When Setting Up PyTorch EnvironmentCommon Issues When Setting Up PyTorch EnvironmentCommon Issues When Setting Up PyTorch EnvironmentCommon Issues When Setting Up PyTorch EnvironmentCommon Issues When Setting Up PyTorch Environment (4) Preparation work is complete, do not close the Anaconda prompt window, just minimize it, and start installing Pytorch

3 Conclusion

The steps to install PyTorch include software installation, hardware configuration, and boot loading. Below is a detailed introduction to each step: 1.

Software installation:

Download the PyTorch installation package that matches your operating system and Python version from the official website (pytorch.org). After decompressing the installation package, run the pip install . command to install PyTorch.

Hardware configuration:

For scenarios using GPU for deep learning computations, ensure that the NVIDIA driver and CUDA toolkit are correctly installed. When installing PyTorch, check if the GPU is available using torch.cuda.is_available().

Boot loading:

Run python -c “import torch; print(torch._version_)” to check if PyTorch is successfully installed.

Leave a Comment