出于某种原因,我不能pip install %CD%\*.whl
,因为我会得到:
Requirement 'C:\\Users\fredrik\\Downloads\\*.whl' looks like a filename, but the file does not exist
`*.whl is not a valid wheel filename.
在macOS上(我相信Linux),我可以毫无问题地做到这一点:
pip install *.whl
Processing ./certifi-2017.11.5-py2.py3-none-any.whl
Processing ./chardet-3.0.4-py2.py3-none-any.whl
Processing ./idna-2.6-py2.py3-none-any.whl
Processing ./requests-2.18.4-py2.py3-none-any.whl
Processing ./urllib3-1.22-py2.py3-none-any.whl
...
pip install *.whl
)在Windows上运行?答案 0 :(得分:7)
如果您知道软件包名称,例如foo
您可以使用:
python -m pip install --find-links=C:\Users\fredrik\Downloads foo
这将找到任何foo
软件包,例如foo-X.Y.Z-cp37-cp37m-win_amd64.whl
等...
如果您不知道软件包名称,则可以尝试:
FOR %%i in (C:\Users\fredrik\Downloads\*.whl) DO python -m pip install %i