Local Python Environment

Configuration a local Python environment for Anyscale development

Anyscale and Ray require a Python 3.6, 3.7, or 3.8 environment In particular, the default MacOS Python will NOT work with Ray.

Python is the go-to language for Ray development. All Python developers cope with environments and dependencies when working, just as you will with Anyscale applications.

We have found Anaconda to provide a good basis for managing multiple Python environments, and it also is available for many operating systems. Virtualenv and pyenv provide similar capabilities.

Setup Anaconda

On a mac using zsh, these instructions install and set up Anaconda:

  • brew install conda

  • conda init zsh

  • source ~/.zshrc

For installation on other platforms, see Anaconda Installers.

Make an environment for your Anyscale work

Anaconda enables you to separate Python environments from one another so that their dependencies can be managed independently.

conda create -n anyscale-env python=3.7 pip
conda activate anyscale-env

This command creates a fresh environment. Any installations you make while the conda environment called "anyscale-env" is active will be limited to just that environment.

When this environment is active, you'll notice that your python command will execute Python 3.7 and all imports will be resolved relative to a special directory for this environment. So if you, for example:

pip install ray
pip install anyscale

These two libraries will be available and frozen in this environment alone.

Last updated

Was this helpful?