ealeng
Menu
← All posts

Feb 19, 2020 · 1 min read

Pipenv how to create python virtual environment

First things first we need to install pipenv, so make sure you have python 3.* and pip installed on your machine. Then create directory for your project (or navigate to existing one): Once you…

python

First things first we need to install pipenv, so make sure you have python 3.* and pip installed on your machine.

$ pip3 install pipenv

Then create directory for your project (or navigate to existing one):

$ cd ~/Desktop 
$ mkdir my_project
$ cd my_project

Once you inside your projects directory you can start using pipenv, in this example we install Flask:

$ pipenv install flask

If you have requirements.txt file then run the command below to get all requirements installed (just make sure you specify requirements.txt file path if it is not in the same directory as your main project):

$ pipenv isntall -r requirements.txt

The last thing left is to activate shell, inside your project directory you should already have Pipfile and Pipfile.lock all you have to do now is run

$ pipenv shell

Now you should be able to work inside your virtual environment.

Learning something useful?

New labs, articles, and videos on evaluating and testing AI systems come out regularly. Follow along so you don't miss the next one.