[Python] Pyenv doesn't change the Python version when doing 'pyenv global 3.7.2'

Discussão em 'Python' iniciado por Stack, Julho 15, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using Ubuntu 16.04 (Xenial Xerus).

    I installed dependencies for pyvenv and pyenv, by:

    su 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 git python-pip


    export PYENV_ROOT="$HOME/.pyenv"
    export PATH="$PYENV_ROOT/bin:$PATH"
    eval "$(pyenv init -)"


    in file ~/.bashrc.

    And I ran

    source ~/.bashrc


    Run the

    pyenv install 3.7.2
    pyenv global 3.7.2


    And pyenv versions shows:

    system
    * 3.7.2 (set by PYENV_VERSION environment variable)


    But python -V shows just the same as my system Python.

    Python 3.5.2


    What did I do wrong?

    Continue reading...

Compartilhe esta Página