Local Development

Pyenv

  • It is a version manager, enabling to shift the versions easily

# install specific version
pyenv install 3.10
# apply version
pyenv global 3.10
# check version
python3 --version

Virtual Environment

  • Venv, is a fully self-contained development environment, complete with its own Python interpreter, libraries, and required dependencies. This creates a separate “mini” Python setup that’s completely isolated from the system-wide Python installation and any other virtual environments you may have.

  • Virtual environments are especially useful when you need to work on multiple projects or multiple versions of the same project without causing conflicts or delays.

  • Make sure that Python interpreter version MUST be matched

# Create venv
python3 -m venv venv
# Enter into venv
source venv/bin/activate
# Exit
deactivate

Package Installation

  • Make sure the dependencies with correct version must be included in requirements.txt

requirements.txt
opensearch==0.9.2
opensearch-py==2.8.0
  • Install the package

pip install -r requirements.txt

Last updated

Was this helpful?