How to Install Pytorch on MacOS?
Last Updated :
23 Jul, 2025
PyTorch is an open-source machine learning library based on the Torch library, used for applications such as computer vision and natural language processing, primarily developed by Facebook's AI Research lab. It is free and open-source software released under the Modified BSD license.
Prerequisites:
Installation Procedure:
Method 1: Using pip to install the required dependencies.
Step 1: Check if python3 is already installed by entering the following command in the command prompt.
python3 --version
If this command runs successfully, and we are able to get a Python version 3.9+ then we are good to go or else install python3 by referring to this article here.
Step 2: Check if pip3 is already installed by entering the following command in the command prompt.
pip3 --version
If this command runs successfully, and we are able to get a pip version then we are good to go or else install pip by referring to this article here.
Step 3: Enter the following command to install the latest stable release of Pytorch.
1. Compute Platform: CPU
pip3 install torch torchvision torchaudio
Step 4: Check if Pytorch is successfully installed by entering the following command in the command prompt.
pip3 show torch
If this command runs successfully, and we are able to get a torch version then we are good to go or else reinstall it.
Method 2: Using conda to install the required dependencies.
Step 1: Activate Anaconda prompt if it is deactivated.
conda activate
Step 2: Check if conda is installed by entering the following command in Anaconda Prompt.
conda --version
If this command runs successfully, and we are able to get a conda version then we are good to go or else install Anaconda on MacOS.
Step 3: Enter the following commands to install the latest stable release of Pytorch.
1. Compute Platform : CPU
conda install pytorch torchvision torchaudio -c pytorch

Step 4: Check if Pytorch is successfully installed by entering the following command in Anaconda prompt.
conda list -f pytorch
If this command runs successfully, and we are able to get a torch version then we are good to go or else reinstall it.
Similar Reads
How to Install PyBrain on MacOS? PyBrain is an open-source and free-to-use Python-based Machine Learning Library. Its main purpose is to provide machine learning tasks with flexible, easy-to-use, still a very powerful algorithms. It also provides a wide range of predefined environments which is used to test and compare different ty
2 min read
How to Install Theano on MacOS? Theano is a Python library that allows us to evaluate mathematical operations including multi-dimensional arrays so efficiently. It is mostly used in building Deep Learning Projects. It works way faster on Graphics Processing Unit (GPU) rather than on the CPU. In this article, we will look into the
1 min read
How to Install Pillow on MacOS? In this article, we will learn how to install Pillow in Python on MacOS. Python Imaging Library (expansion of PIL) is the de facto image processing package for Python language. Installation:Method 1: Using pip to install Pillow Follow the below steps to install the Pillow package on macOS using pip:
2 min read
How to Install Python sympy on MacOS? Sympy is a lightweight, open-source Python library for symbolic math. Its vision is to become a fully functional computer algebra system while keeping the code as simple, understandable, and extensible as possible. Sympy relies only on mpmath, a pure Python library for arbitrary floating-point arith
2 min read
How to Install Seaborn on MacOS? In this article, we will learn how to install seaborn in Python on MacOS. Seaborn is a library for making statistical graphics in Python. It is built on top of matplotlib and is closely integrated with pandas data structures. Installation:Method 1: Using pip to install Seaborn Package Follow the bel
2 min read
How to Install Opencv 4 on MacOS? In this article, we will learn how to install Opencv 4 in Python on MacOS. OpenCV (Open Source Computer Vision Library) is a library of programming functions mainly aimed at real-time computer vision. Installation:Method 1: Using pip to install Opencv 4 Package Follow the below steps to install the
2 min read