파이썬 버전 관리 Pyenv 설치

2025. 4. 3. 20:43·Programming/Python

 

 

Pyenv 설치

Build Dependencies

sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl git \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

 

 

Installation

curl -fsSL https://pyenv.run | bash

 

  • bash
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init - bash)"' >> ~/.bashrc

 

  • zsh
  echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
  echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
  echo 'eval "$(pyenv init - zsh)"' >> ~/.zshrc

 

 

Restart shell

exec "$SHELL"

 

 

Usage

pyenv install 3.12
pyenv global 3.12

 

 

 

 

참고

 

Managing Multiple Python Versions With pyenv – Real Python

In this step-by-step tutorial, you'll learn how to install multiple Python versions and switch between them with ease, including project-specific virtual environments, even if you don't have sudo access with pyenv.

realpython.com

 

'Programming > Python' 카테고리의 다른 글

mise로 Python 버전 관리하기  (0) 2025.03.11
'Programming/Python' 카테고리의 다른 글
  • mise로 Python 버전 관리하기
Z0e
Z0e
3D Vision Engineer, Zoe 입니다.
  • Z0e
    I'm not a robot
    Z0e
    • 분류 전체보기
      • Spatial AI
        • Geometry
        • SLAM
      • Programming
        • Python
        • Git
        • Docker
      • Setting
        • Ubuntu
        • ROS
      • Study
        • Google Skills
  • 인기 글

  • hELLO· Designed By정상우.v4.10.3
Z0e
파이썬 버전 관리 Pyenv 설치
상단으로

티스토리툴바