Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pip Install -r requirements.txt Without Failing

I am trying to install all the dependencies from requirements.txt using pip install -r requirements.txt. Often times it will stop if one of the packages is already installed or one of the packages is not found.

How can I avoid that? i.e. Ignore the package that is causing the error and move to the next one.

Also, I am creating my requirements.txt using pip freeze > requirements.txt from my conda virtual environment.

requirements.txt:

attrs==19.1.0
backcall==0.1.0
bleach==3.1.0
certifi==2019.3.9
chardet==3.0.4
Click==7.0
cycler==0.10.0
DateTime==4.3
decorator==4.4.0
defusedxml==0.5.0
entrypoints==0.3
future==0.17.1
geocoder==1.38.1
geographiclib==1.49
geopy==1.19.0
idna==2.8
importlib-resources==1.0.2
ipykernel==5.1.0
ipython==7.4.0
ipython-genutils==0.2.0
ipywidgets==7.4.2
jedi==0.13.3
Jinja2==2.10
jsonschema==3.0.1
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
kiwisolver==1.0.1
MarkupSafe==1.1.1
matplotlib==3.0.3
mistune==0.8.4
mkl-fft==1.0.10
mkl-random==1.0.2
nbconvert==5.4.1
nbformat==4.4.0
notebook==5.7.6
numpy==1.16.2
pandas==0.24.2
pandocfilters==1.4.2
parso==0.3.4
patsy==0.5.1
pexpect==4.6.0
pickleshare==0.7.5
prometheus-client==0.6.0
prompt-toolkit==2.0.9
ptyprocess==0.6.0
Pygments==2.3.1
pyodbc==4.0.26
pyparsing==2.3.1
pyrsistent==0.14.11
python-dateutil==2.8.0
pytz==2018.9
pyzmq==18.0.0
qtconsole==4.4.3
ratelim==0.1.6
requests==2.21.0
scikit-learn==0.20.3
scipy==1.2.1
seaborn==0.9.0
Send2Trash==1.5.0
Shapely==1.6.4.post2
six==1.12.0
statsmodels==0.9.0
terminado==0.8.1
testpath==0.4.2
timezonefinder==4.0.1
tornado==6.0.2
traitlets==4.3.2
tzwhere==3.0.3
urllib3==1.24.1
wcwidth==0.1.7
webencodings==0.5.1
widgetsnbextension==3.4.2
zope.interface==4.6.0

Error:

Could not find a version that satisfies the requirement mkl-fft==1.0.10 (from -r requirements.txt (line 33)) (from versions: ) No matching distribution found for mkl-fft==1.0.10 (from -r requirements.txt (line 33))

Thanks a lot in advance!

like image 906
Krishnang K Dalal Avatar asked Oct 17 '25 01:10

Krishnang K Dalal


2 Answers

Install them one by one

cat requirements.txt | xargs -n 1 pip install
like image 122
Jerry An Avatar answered Oct 19 '25 15:10

Jerry An


You should use the --ignore-installed flag https://pip.pypa.io/en/stable/reference/pip_install/#cmdoption-i
If you don't want a package to be installed, just remove it from requirements.txt. Or try this. Stop pip from failing on single package when installing with requirements.txt

like image 24
Devesh Kumar Singh Avatar answered Oct 19 '25 17:10

Devesh Kumar Singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!