Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install multiple whl files in cmd

Tags:

python

cmd

I know how to install *.whl files through cmd (the code is simply python -m pip install *so-and-so-.whl). But since I accidentally deleted my OS and had no backups I found myself in the predicament to reinstall all of my whl files for my work.

This comes up to around 50 files. I can do this manually which is pretty simple, but I was wondering how to do this in a single line. I can't seem to find anything that would allow me to simply type in python -m pip install *so-and-so.whl to find all of the whl files in the directory and install them.

Any ideas?

like image 413
Kaelan O'reily Avatar asked Apr 10 '17 03:04

Kaelan O'reily


People also ask

Can I pip install multiple packages?

To pip install more than one Python package, the packages can be listed in line with the same pip install command as long as they are separated with spaces. Here we are installing both scikit-learn and the statsmodel package in one line of code. You can also upgrade multiple packages in one line of code.


1 Answers

In Windows cmd you can use a for loop to do this:

for %x in (dir *.whl) do python -m pip install %x
like image 189
Stephen Rauch Avatar answered Oct 04 '22 01:10

Stephen Rauch