D
D
Dmitry Vyatkin2015-12-03 00:20:17
Django
Dmitry Vyatkin, 2015-12-03 00:20:17

How to install only uninstalled applications via pip install -r requirements txt?

When I run the command, it downloads and installs applications, but how to check if the application is installed and install only those that are not installed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
marazmiki, 2015-12-03
@dim137

Generally speaking, pip does just that—it installs a package only if the specified requirement is not met:

(.virtualenv) $ pip freeze > requirements.txt
(.virtualenv) $ pip install -r requirements.txt 
Requirement already satisfied (use --upgrade to upgrade): Django==1.9 in ./.virtualenv/lib/python3.4/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): dj-database-url==0.3.0 in ./.virtualenv/lib/python3.4/site-packages (from -r requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): psycopg2==2.6.1 in ./.virtualenv/lib/python3.4/site-packages (from -r requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): wheel==0.26.0 in ./.virtualenv/lib/python3.4/site-packages (from -r requirements.txt (line 5))
Cleaning up...

Maybe you have an old package installed, like package-name==0.1, but requirements.txt says something complicated like package-name>=0.3,<0.4? Or a dev repository that is downloaded from git?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question