Installation of PyCaret

Learn how to install and set up PyCaret on your local machine.

Software requirements

The code in this course should work on all major operating systems, that is, Microsoft Windows, Linux, and Apple macOS. We’ll need Python 3 and JupyterLab installed on our computer. Another useful tool is Anaconda, a machine learning and data science toolkit that includes numerous helpful libraries and software packages. Anaconda can be freely downloaded at this link. Alternatively, you can use a cloud service like Google Colab to run Python code without worrying about installing anything on your machine.

Installing PyCaret

The PyCaret library can be installed locally by executing the following command on your Anaconda terminal. You can also execute the same command on Google Colab or a similar service, to install the library on a remote server.

pip install pycaret[full]==2.3.4

After executing this command, PyCaret will be installed and we’ll be able to run all code examples of the course. It is recommended to install the optional dependencies as well, by including the [full] specifier. Furthermore, installing the correct package version ensures maximum compatibility. This course uses PyCaret ver. 2.3.4. Finally, creating a conda environment for PyCaret is considered to be best practice because it will help you avoid conflicts with other packages and make sure you always have the correct dependencies installed.

Installing Spacy and Textblob

PyCaret NLP module requires the Spacy English language model, as well as the TextBlob corpora. These aren’t included with the PyCaret installation, so you have to download them manually, by executing the following commands on your Anaconda terminal.

python -m spacy download en_core_web_sm
python -m textblob.download_corpora

After doing that, the additional resources are going to be downloaded and you’ll be able to use the natural language processing module without any problems. Obviously, if you have already downloaded those files for another project that utilizes the Spacy and TextBlob libraries, you can safely skip this step

Using JupyterLab

JupyterLab is a powerful web-based user interface that lets us create and execute Jupyter notebooks containing Python code. We can run JupyterLab by executing the following command on the Anaconda terminal. Substituting lab with notebook will run the older Jupyter Notebook web interface, but do that only if you have problems or compatibility issues with JupyterLab.

jupyter lab

When JupyterLab starts, you can create a new Jupyter Notebook and run the code that is provided in each chapter of the course. After executing a Jupyter Notebook, both the code and its output are displayed to the user. This file format can also contain text, figures, and visualizations. Jupyter Notebook is a powerful format that has become the standard in data science and machine learning. You can refer to the official JupyterLab Documentation for more information and help about using JupyterLab. In the above chapters, each code snippet represents a single Jupyter Notebook cell that can be executed by pressing the “Shift” + “Enter” keyboard shortcut.

Installing Streamlit

You can easily install the Streamlit Python library by executing the following command on our terminal. pip install streamlit.

Github repository

You can access all code examples included in this course at the official Github repository. Each folder contains the Python code of the same-titled course chapter. You can also clone the repository to your local machine if you wish. Git is the de facto standard for version control, so it’s assumed that most developers will be familiar with it. In case you haven’t used it, please refer to the official quick reference guide.

Get hands-on with 1400+ tech skills courses.