How to install Great Expectations locally
This guide will help you Install Great Expectations locally for use with Python.
This guide assumes you have:
- Installed a supported version of Python: 3.7 to 3.10 (For details on how to download and install Python on your platform, please see Python's documentation and download sites.)
- Great Expectations is developed and tested on macOS and Linux Ubuntu. Installation for Windows users may vary from the steps listed below. If you have questions, feel free to reach out to the community on our Slack channel.
- If you have the Mac M1, you may need to follow the instructions in this blog post: Installing Great Expectations on a Mac M1.
Steps
1. Check Python version
First, check the version of Python that you have installed. As of this writing, Great Expectations supports versions 3.7 through 3.10 of Python.
You can check your version of Python by running:
python --version
If this command returns something other than a Python 3 version number (like Python 3.X.X), you may need to try this:
python3 --version
2. Choose installation method
Our recommended best practice is to use a virtual
environment for your Great Expectations installation.
Both standard Python 3 and Anaconda support the
creation of virtual environments. Once the virtual
environment is created, you can then use either
pip
or conda
to install
project requirements, depending on how the virtual
environment was created.
- pip
- conda
Once you have confirmed that Python 3 is
installed locally, you can create a virtual
environment with venv
before
installing your packages with pip
.
Python Virtual Environments
Depending on whether you found that you needed
to run python
or
python3
in the previous step, you
will create your virtual environment by running
either:
python -m venv my_venv
or
python3 -m venv my_venv
This command will create a new directory called
my_venv
where your virtual
environment is located. In order to activate the
virtual environment run:
source my_venv/bin/activate
You can name your virtual environment
anything you like. Simply replace
my_venv
in the examples above
with the name that you would like to use.
Once your virtual environment is activated, you should ensure that you have the latest version of pip installed.
Pip is a tool that is used to easily install Python packages. If you have Python 3 installed you can ensure that you have the latest version of pip by running either:
python -m ensurepip --upgrade
or
python3 -m ensurepip --upgrade
Anaconda is a package and management system that supports Python. If you choose to go through the installation process using Anaconda, you will want to ensure that Anaconda is installed by running:
conda --version
If no version number is printed, you can download Anaconda here.
Once Anaconda is installed, you can create and activate a new virtual environment by running:
conda create --name YOUR_ENVIRONMENT_NAME
conda activate YOUR_ENVIRONMENT_NAME
Replace "YOUR_ENVIRONMENT_NAME" with the name you wish you use for your environment.
3. Install Great Expectations
Once you have your virtual environment created and activated, you will be able to use either pip or Anaconda to install Great Expectations.
- pip
- conda
You can use pip to install Great Expectations by running the appropriate pip command below:
python -m pip install great_expectations
or
python3 -m pip install great_expectations
You can use Anaconda to install Great Expectations by running:
conda install -c conda-forge great-expectations
4. Verify Great Expectations installation succeeded
You can confirm that installation worked by running:
great_expectations --version
This should return something like:
great_expectations, version 0.15.49
🚀🚀 Congratulations! 🚀🚀 You successfully installed Great Expectations.