python-pytorchHow do I install Python and PyTorch on Windows?
- Download and install the latest version of Python 3 from the Python website.
- Open the command prompt and type
pip install torch
to install PyTorch. - To check the installation, type
python
in the command prompt and you should see something like this:
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
- Type
import torch
and you should see something like this:
>>> import torch
>>>
- To check the version of PyTorch, type
print(torch.__version__)
and you should see something like this:
>>> print(torch.__version__)
1.2.0
>>>
- To check the available packages in PyTorch, type
print(torch.utils.package_dir)
and you should see something like this:
>>> print(torch.utils.package_dir)
C:\Users\USERNAME\AppData\Local\Programs\Python\Python37\lib\site-packages\torch
>>>
- You have successfully installed Python and PyTorch on Windows.
Helpful links
More of Python Pytorch
- How can I use Yolov5 with PyTorch?
- How can I use Python, PyTorch, and YOLOv5 to build an object detection model?
- How can I use Python and PyTorch to parse XML files?
- How do I use Pytorch with Python 3.11 on Windows?
- How do I install Python PyTorch Lightning?
- How can I use PyTorch with Python 3.11?
- How can I use PyTorch with Python 3.10?
- How can I use Python PyTorch with CUDA?
- How do I use PyTorch with Python version 3.11?
- What is the most compatible version of Python to use with PyTorch?
See more codes...