Open In App

How to Install PyScreenshot in MacOS?

Improve
Improve
Like Article
Like
Save
Share
Report

PyScreenshot is a Python module. It was built since the PIL ImageGrab module only supported Windows, although Pillow now supports Linux and macOS as well. Flexible backends, Wayland compatibility, occasionally superior performance, and optional sub processing are some of the capabilities in PyScreenshot that can be useful in particular scenarios. Using various back-ends, the module can copy the contents of the screen to a Pillow image memory. The ImageGrab module has been replaced by this module. In most circumstances, the PyScreenshot module is no longer needed.

Installing PyScreenshot on MacOS

Method 1: Using pip to install PyScreenshot Package

Follow the below steps to install the PyScreenshot package on macOS using pip:

Step 1: Install the current version of Python3 in macOS. 

Step 2: Check if pip3 and python3 are correctly installed in your system using the following commands:

python3 –version

pip3 –version

Checking-pip3-and-python3

Step 3: Upgrade pip3 to avoid errors occurring during the installation process.

pip3 install –upgrade pip

Upgrading-pip3

Step 4: Enter the following command to install PyScreenshot using pip3.

pip3 install PyScreenshot

Installing-pyscreenshot-package

Method 2: Using setup.py to install PyScreenshot

Follow the below steps to install the PyScreenshot package on macOS using the setup.py file:

Step 1: Download the latest source package of PyScreenshot for python3 from the website

curl https://files.pythonhosted.org/packages/d1/75/424e89c341b54040423f55c08cf94946bc38c3fcc4cadbae05e12c09cd2a/pyscreenshot-3.0.tar.gz > pyscreenshot.tar.gz

Downloading-the-source-package-for-PyScreenshot

Step 2: Extract the downloaded PyScreenshot package using the following command.

tar -xzvf pyscreenshot.tar.gz

Extracting-the-pyscreenshot.tar.gz-file

Step 3: Go inside the pyscreenshot-3.0 folder and enter the following command to install the package.

cd pyscreenshot-3.0

python3 setup.py install

Installing-pyscreenshot-using-setup.py-file

Verifying PyScreenshot installation on macOS:

Use the following import in your Python terminal to verify if the PyScreenshot installation has been done properly or not:

import pyscreenshot

Verifying pyscreenshot installation on macOS

If we do not get any error while importing the module then is not installed properly.


Last Updated : 31 Jan, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads