Skip to content

Using Pip

Timothy Ko edited this page May 20, 2018 · 5 revisions

Using Pip

Using pip would require a little bit more steps, since you would have to use pip and virtualenv separately. In addition, managing requirements.txt can be a pain. For more benefits pipenv solves, look at their documentation. I'd recommend using Pipenv but if you still haven't changed your mind, here are the instructions.

Always remember to use the same virtual environement!!!! This is a good practice for any python development.
First, install virtualenv, create and activate the environment called venv:

$ pip3 install virtualenv
$ virtualenv -p python3 venv
$ source venv/bin/activate

You will then have a (venv) before the $, meaning that you are now in your virtual environment. Then, install the python package dependencies, which include Flask.

(venv)$ pip install -r requirements.txt

To deactivate when you're using it:

(venv)$ deactivate venv

If you are using pip, your command line will have (venv)$ in front instead of the (flask......) bash-3.2$ Now look above for instructions to run the server.