- After cloning, first migrate the
HOMEarea from the/homearea to under/raid/projects
$ bash migrate_home.shNote: Before moving onto step 2 you will need to update your current environment.
You can do this either by logging out and then logging back in, or by sourcing your /raid/projects/${USER}/.bash_profile.
- In your
/raid/projects/${USER}/.bash_profilemake sure that the following comment exists anywhere above the sourcing of~/.bashrcto set the start location for addingpyenvinformation to your.bash_profile
# pyenv setupand then run
$ bash pyenv_setup.sh- Source your
.bash_profileto make sure everything is setup and then install CPythonv3.8.11from source with optimizations usingpyenv
$ . ~/.bash_profile
$ bash build_python.shAs a simple test that everything is working okay:
- Create a
pyenvvirtual environment
$ pyenv virtualenv 3.8.11 base- Activate the
basevirtual environment
$ pyenv activate base- Install some dependencies with
pip
(base) $ python -m pip install --upgrade pip setuptools wheel
(base) $ python -m pip install matplotlib- Run a test example Python script
(base) $ python test/example.pywhich should produce a plot named mpl_example.png in your current working directory.
MLFlow works best with Conda for managing environments.
pyenv has the ability to install Conda distributions as well, so you can pyenv install whatever distribution you'd like (c.f. output of pyenv install --list | grep conda)
$ pyenv install miniconda3-latestTo be able to use Conda for package management with or without pyenv, use the installed miniconda distribution to initialize Conda
$ pyenv shell miniconda3-latest
$ conda init
$ conda config --set auto_activate_base falseand after a shell restart conda will now be found and useable.
You can treat the miniconda version that you've selected as you would any other pyenv version when creating a pyenv virtual environment.
$ pyenv virtualenv miniconda3-latest mlflow-baseThese Conda pyenv environments can be activated with either pyenv activate or conda activate, though it is recommended to only use pyenv activate as switching between pyenv environments with a conda environment activated will not update the Python runtime used.
Note that it is important to make sure the auto_activate_base false command is run — which results in the following being added to your .condarc
$ grep auto_activate ~/.condarc
auto_activate_base: false— to ensure that there won't be conflict between Conda environment Python runtimes and any other virtual environment that you have.
As conda init will still place condabin onto PATH you will not need to update MLFlow's MLFLOW_CONDA_HOME shell variable.