• Home
  • Blog
  • About Me

Box 1663

Passes must be presented.

  • Developer
  • Transition to PC

Set up Virtualenv and Virtualenvwrapper on Ubuntu 18.04

July 10, 2019 By Scott Leave a Comment

I prefer setting up virtualenv and virtualenvwrapper using pip rather than apt-get to ensure I am using the latest version and not relying on Ubuntu’s apt repositories to keep up. However, since I am installing pip from the repository, I have run into issues in the past when trying to upgrade pip and install virtualenv and virtualenvwrapper globally. I install almost all other packages into project specific virtual environments. This post is to remind myself of the proper steps, so hopefully you find it useful as well.

First update and install pip for Python 3

sudo apt update && sudo apt install python3-pip

Now upgrade pip to the latest version

sudo -H pip3 install --upgrade pip

Install virtualenv and virtualenvwrapper

sudo -H pip3 install virtualenv virtualenvwrapper

Configure .bashrc

echo "export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3" >> ~/.bashrc

echo "export WORKON_HOME=~/.virtualenv" >> ~/.bashrc

echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc

And finally, activate virtualenvwrapper

source ~/.bashrc

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

Filed Under: Developer, Featured Tagged With: Development, Python

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Set up Virtualenv and Virtualenvwrapper on Ubuntu 18.04

July 10, 2019 By Scott Leave a Comment

Metasploitable 3 Without Vagrant

September 7, 2018 By Scott Leave a Comment

A Brief Intro to Command Line Git

August 11, 2017 By Scott Leave a Comment

Copyright © 2023 · Box 1663 · Log in