Tuesday, April 21, 2020

How to Not Mess Up your Python Dependencies Using Virtualenv

Don't you hate it when you try to pip install something and you get some super annoying error?  Me too.  The solution is a virtual environment.
virtualenv -p python3 venv
 This command creates a virtual environment in the directory "venv" under the current directory.  The command specifies python3 as opposed to 2, because it's 2020 and you should be using Python3.

Then, activate the virtual environment:
source venv/bin/activate
You should now see "(venv)" prepended to your command line.

To install something, just use "pip install [PACKAGE]".  You don't need to specify a directory target or use pip3, because the virtualenv is already set!

If you have a requirements document, you can install all of them with "pip install -r requirements.txt".

Hopefully I'll update this post with some specific error messages to make it more useful in search engine results.

1 comment:

  1. The game consists of 20 fixed pay traces locked into a timeless 5-reel, 3-row layout. It’s a medium variance slot full of thrilling options and crowd pleasing graphics. We would like to remind you that underage gambling is against the law|is unlawful}. To benefit from the providers of Mr Vegas you have to be minimal of|no less than} 18 years of age or the age required by the jurisdiction applicable to you, whichever is 토토사이트 higher.

    ReplyDelete