Posts

Showing posts with the label developer tools

Guide to Managing Python Environments with pyenv and Poetry

Image
Introduction pyenv is a tool for managing multiple Python versions on the same system, while Poetry is a modern tool for dependency management and project packaging. This combination helps developers control exact Python versions, automate virtual environment creation, and ensure consistent libraries across different machines. Detail First, use the following commands to install and use pyenv and poetry brew install pyenv poetry pyenv install 3.11.9 pyenv global 3.11.9 pyenv local 3.12.0 poetry env use python poetry config virtualenvs.in-project true poetry init -n poetry add requests poetry install brew install pyenv poetry: Install pyenv and poetry tools via Homebrew. pyenv install 3.11.9: Install Python version 3.11.9 to the system, you could install multiple Python version with the same way. pyenv global 3.11.9: Set Python 3.11.9 as the system-wide default version. pyenv local 3.12.0: Set Python 3.12.0 as the specific version for the current directory. poetry env...