Installing the latest release
Installing PyCaret is the first step towards building your first machine learning model in PyCaret. Installation is easy and takes only a few minutes. All dependencies are also installed with PyCaret. Click here to see the complete list of dependencies. Using the command line interface in python or in any notebook environment, run the below command to install PyCaret.
#installing for the first time pip install pycaret #if you have installed beta version in past, run the below code to upgrade pip install --upgrade pycaret #Run the below code in your notebook to check the installed version from pycaret.utils import version version()
Note that in order to avoid potential conflicts with other packages it is strongly recommended to use a virtual environment, e.g. python3 virtualenv (see python3 virtualenv documentation) or conda environments. Using an isolated environment makes it possible to install a specific version of pycaret and its dependencies independently of any previously installed Python packages. If you are already using Anaconda distribution, see below for an example of how you can create an environment using your Anaconda Prompt.
#create a conda environment conda create --name yourenvname python=3.6 #activate environment conda activate yourenvname #install pycaret pip install pycaret #create notebook kernel connected with the conda environment python -m ipykernel install --user --name yourenvname --display-name "display-name"
Recommended Environment for use
You can use PyCaret in your choice of Integrated Development Environment (IDE) but since it uses html and several other interactive widgets, it is optimized for use within notebook environment, be it Jupyter Notebook, Jupyter Lab, Azure Notebooks or Google Colab.
Building from source
You can also download the source file from the link below and use the pip installer to install the package from a downloaded file. To install the package using the source file, download the file and use the command line or notebook environment to run the below cell of code.
#Install using source file pip install C:/path_to_download/pycaret-version.tar.gz
For Google Colab
PyCaret uses interactive plotting ability. In order to render interactive plots in Google Colab, run the below line of code in your colab notebook.
#For Google Colab only from pycaret.utils import enable_colab enable_colab()
For MAC OS
MAC users will have to install LightGBM separately using Homebrew, or can be built using CMake and Apple Clang or gcc. See the instructions below:
- Install CMake (3.16 or higher)
>> brew install cmake
- Install OpenMP
- >> brew install libomp
- Run the following command in terminal:
git clone --recursive https://github.com/microsoft/LightGBM ; cd LightGBM mkdir build ; cd build cmake .. make -j4
Try this next
Was this page helpful?