Installing Lazy Predict on Apple Silicon

Tanuj Wadhi
3 min readApr 22, 2022

--

Photo by Steinar Engeland on Unsplash

If you haven’t yet heard of Lazy Predict and have stumbled upon this article by random chance (sidenote: Is random ever really random?), then i highly suggest you check out these articles explaining what it is:

On the other hand, if you’ve heard the rave about this package and are stuggling to install on it your brand spanking new Mac with the shiny new Apple Silicon, then read on…

I’m going to cut to the chase, assuming you’ve already tried pip and conda, and GitHub issues page, and are now scouring trusty old Google in search of a solution. Well, it’s your lucky day!

Note: This was tested with Python 3.9 on a MacBook Pro with M1 Max running macOS Monterey 12.3.1

Step 1

Download the github codebase for Lazy Predict from https://github.com/shankarpandala/lazypredict/tree/master

Step 2

In the downloaded folder, open the requirements.txt file in your favorite text/code editor. It should look something like this:

Requirements for lazypredict
Original Requirements

This is where the installation issue lies. You see, a lot of the package versions are quite old, older than the M1 itself. Which is why they are not available from conda forge. To rectify the issue, just delete the package versions OR use the package versions as below (working as of April 22, 2022):

To rectify the installation issue, just delete the package versions OR use the package versions as below (working as of April 22, 2022) in the requirements.txt file

click==7.1.2
joblib==1.1.0
lightgbm==3.3.2
numpy==1.21.6
pandas==1.1.4
pytest==7.1.1
PyYAML==6.0
scikit-learn==1.0.2
scipy==1.8.0
six==1.15.0
tqdm==4.64.0
xgboost==1.5.1

Step 3

Open terminal and navigate to the downloaded folder to make it the current working directory. Once you’re in the folder, run:

make install

This will add a few new folders to the library, including a folder name build. Navigate to build>lib and there you will see a folder called lazypredict.
This is essentially the package you’ve been trying to install. One last step and it will be usable!

Step 4

Copy the lazypredict folder and navigate over to your site packages folder. This is usually Users/{USER_NAME}/miniforge3/lib/python3.x/site-packages/ . If you’re unable to locate this directory, you can easily identify the correct directory for your environment by calling any package and looking at it’s location, as shown below:

Once inside site-packages, paste the lazypredict folder, and voilá you’re done!

Testing

To test if it’s working, simple open your favorite python IDE and import lazy predict. If you don’t see any errors, the installation was successful!

Now head on over to https://lazypredict.readthedocs.io/en/latest/ and start predicting at warp speeds!

--

--