Skipping error when installing packaging using PIP

I run pip

pip install -r /requirements.txt 

If one of my packages fails, all things are interrupted and no other packages will be installed.

Is there a command that, in case of an error, will continue to install the next package?

So, for my use: here is what I do using the fab file:

 def _install_requirements(): """ Installs the required packages from the requirements.txt file using pip. """ if not exists(config.SERVER_PROJECT_PATH + '/requirements.txt', use_sudo=True): print('Could not find requirements') return sudo('pip install -r %s/requirements.txt' % SERVER_PROJECT_PATH) 
+6
source share
1 answer

There is a convenient python script for updating all libraries using pip ( source ):

 import pip from subprocess import call for dist in pip.get_installed_distributions(): call("pip install --upgrade " + dist.project_name, shell=True) 

In the for loop, you can fulfill the requirements.

 # read requirements.txt file, create list of package names for package in requirements: call("pip install " + package, shell=True) 

This will not crash if you cannot install the package.

+4
source

Source: https://habr.com/ru/post/969537/


All Articles