Local Environment
Python is the go-to language for Ray development. Anyscale and Ray require a Python 3.6, 3.7, or 3.8 environment. 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.
Set up Anaconda
On a Mac using zsh
, these instructions install and set up Anaconda:
- Mac (Intel)
- Mac (ARM)
brew install conda
conda init zsh
source ~/.zshrc
curl -LO https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
chmod +x Miniforge3-MacOSX-arm64.sh
./Miniforge3-MacOSX-arm64 -u
conda init zsh
source ~/.zshrc
For installation on other platforms, download and install Anaconda using 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. For example, you might run:
pip install ray
pip install anyscale
These two libraries will be available and frozen in this environment alone.
note
If you're using a Mac powered by an ARM processor (Apple M1, Apple M1 Pro or Apple M1 Max) you'll have to run pip uninstall grpcio; conda install grpcio
in your Conda environment for Ray and Anyscale to work.