本文介绍了如何在cmd中安装多个whl文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何通过cmd安装 *.whl 文件(代码只是 python -m pip install * so-and-so-.whl ).但是由于我不小心删除了操作系统并且没有备份,因此我陷入了为我的工作重新安装所有whl文件的困境.

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.

这最多可包含约50个文件.我可以手动执行此操作,这非常简单,但是我想知道如何在一行中执行此操作.我似乎找不到任何可以让我直接输入 python -m pip install * so-and-so.whl 的东西来查找目录中的所有whl文件并进行安装.

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.

有什么想法吗?

推荐答案

在Windows cmd 中,您可以使用for循环来做到这一点:

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

for %x in (dir *.whl) do python -m pip install %x

这篇关于如何在cmd中安装多个whl文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-14 11:52