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:
- Download: Visit the official Anaconda website and download either the full Anaconda distribution or the smaller Miniconda installer.
- Install: Run the installer and follow the on-screen instructions to install Conda on your system.
- Initialize: Open a new terminal window and initialize Conda by running
conda init
. This sets up your shell to use Conda.conda init
- Verify Installation: Verify that Conda is installed correctly by running
conda --version
in the terminal.conda --version
- 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
- Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install pyenv using Homebrew
brew install pyenv
- 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 -)"
- Restart your shell or run
source ~/.bash_profile
- Install Python versions with pyenv
pyenv install python=3.10
Windows (using Git Bash)
- Install Git for Windows
- Download and install Git for Windows from https://gitforwindows.org/.
- Install pyenv using Git Bash: Run the following commands in Git Bash
git clone https://github.com/pyenv-win/pyenv-win.git "$HOME/.pyenv"
- 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 -)"
- Restart Git Bash.
- Install Python versions with pyenv
pyenv install <desired-python-version>
Ubuntu
- 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
- Clone pyenv from GitHub
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
- 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 -)"
- Restart your shell or run
source ~/.bashrc
- Install Python versions with pyenv
pyenv install <desired-python-version>
Updated 6 months ago