Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it necessary to use virtualenv to use Flask framework?

I just started exploring Flask. Earlier I tried to explore Django but found it a bit complicated. However, Installing Flask requires us to install virtualenv first which, As I can recall, is not required in the case of Django.

In case it is not required, how to go ahead without virtualenv?

like image 241
mayankkaizen Avatar asked Sep 24 '15 08:09

mayankkaizen


1 Answers

No, there is no requirement to use a virtualenv. No project ever would require you to use one; it is just a method of insulating a collection of Python libraries from other projects.

I personally do strongly recommend you use a virtualenv, because it makes it much, much easier to swap out versions of libraries and not affect other Python projects.

Without a virtualenv, you just continue with installing the dependencies, and they'll end up in your system libraries collection. Installing the Flask project with pip will pull in a few other packages, such as Werkzeug, Jinja2 and itsdangerous. These would all be installed 'globally'.

like image 79
Martijn Pieters Avatar answered Sep 20 '22 23:09

Martijn Pieters