Environment Setup

Setup your Python Environment

To get started with Markov SDK, create a virtual Python environment using Conda or Pyenv.

📘

Note

This documentation primarily focuses on using the conda environment for examples and steps, although both conda and pyenv should function similarly.

Conda Environment Setup

Download and install conda in your local system using the below steps:

  1. Download: Visit the official Anaconda website and download either the full Anaconda distribution or the smaller Miniconda installer.
  2. Install: Run the installer and follow the on-screen instructions to install Conda on your system.
  3. Initialize: Open a new terminal window and initialize Conda by running conda init. This sets up your shell to use Conda.
    conda init
    
  4. Verify Installation: Verify that Conda is installed correctly by running conda --version in the terminal.
    conda --version
    
  5. Start Using: You are now ready to start using Conda to manage your Python environments and packages.

Create your virtual conda environment to run Markov SDK.

Step 1: Python Version Check

If you are using an existing Python environment, make sure it is a MarkovML-supported version. Use the following command to check your Python version.

🚧

Python version

MarkovML supports Python 3.8 to 3.10

python --version

Step 2: Create your Conda environment

Let's name the conda environment asenv_markovsdk.

conda create --name env_markovsdk python=3.10

After creating the environment, you need to activate it to use it.

conda activate env_markovsdk

That's it! You have successfully created a conda environment.

Pyevn Environment Setup

Setting up pyenv on macOS, Windows, and Ubuntu involves similar steps, although there might be slight differences in the commands and installation procedures. Below are the general steps for each operating system:

macOS

  1. Install Homebrew (if not already installed)
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Install pyenv using Homebrew
    brew install pyenv
    
  3. Add pyenv init to shell
    Add the following to your shell profile (e.g., ~/.bash_profile, ~/.zshrc):
    export PATH="$HOME/.pyenv/bin:$PATH"
    eval "$(pyenv init --path)"
    eval "$(pyenv virtualenv-init -)"
    
  4. Restart your shell or run
    source ~/.bash_profile
    
  5. Install Python versions with pyenv
    pyenv install python=3.10
    

Windows (using Git Bash)

  1. Install Git for Windows
  2. Download and install Git for Windows from https://gitforwindows.org/.
  3. Install pyenv using Git Bash: Run the following commands in Git Bash
    git clone https://github.com/pyenv-win/pyenv-win.git "$HOME/.pyenv"
    
  4. Add pyenv to PATH
    Add the following to your shell profile (e.g., ~/.bash_profile, ~/.bashrc, or ~/.profile)
    export PYENV="$HOME/.pyenv"
    export PATH="$PYENV/bin:$PATH"
    eval "$(pyenv init --path)"
    eval "$(pyenv virtualenv-init -)"
    
  5. Restart Git Bash.
  6. Install Python versions with pyenv
    pyenv install <desired-python-version>
    

Ubuntu

  1. Install pyenv dependencies
    sudo apt-get update
    sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
    libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
    xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git
    
  2. Clone pyenv from GitHub
    git clone https://github.com/pyenv/pyenv.git ~/.pyenv
    
  3. Add pyenv init to shell:
    Add the following to your shell profile (e.g., ~/.bashrc, ~/.bash_profile, ~/.zshrc)
    export PATH="$HOME/.pyenv/bin:$PATH"
    eval "$(pyenv init --path)"
    eval "$(pyenv virtualenv-init -)"
    
  4. Restart your shell or run
    source ~/.bashrc
    
  5. Install Python versions with pyenv
    pyenv install <desired-python-version>
    


What’s Next