Installing Virtualenv (Pyenv) with Python 3.5 on Ubuntu

Linux already comes with python 2.7 installed, and in this tutorial we will update it to version 3.5.0, it is easy you just need to follow this steps:

  • Check python version on Terminal ( Ctrl + Alt + T open terminal)

    python -V

  • Installing the pyenv

     curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash

  • Install dependencies before pyenv

    sudo apt-get update && sudo apt-get upgrade
    sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev git

  • Add to ~/.bashrc at the end of file

    export PATH="~/.pyenv/bin:$PATH"
    eval "$(pyenv init -)"
    eval "$(pyenv virtualenv-init -)"

  • Test with the command(you may need to restart terminal):

    pyenv versions
    * 3.5.0 (set by /home/{user}/.pyenv/version)

  • Install python on pyenv

    • pyenv install 3.5.0
  • Set Python 3.5 as global pyenv

    • pyenv global 3.5.0
  • Check if version 3.5.0 is selected with the command

    • pyenv versions
  • Test the python version with:

    • python -V

Congratulations you have Python 3.5.0 configured on your machine!

Advertisements

Author: Tiago Almeida

I am a Python / Django developer with passion about Data Science and Machine Learning.

1 thought on “Installing Virtualenv (Pyenv) with Python 3.5 on Ubuntu”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s