由于某种原因,我不能,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.
Run Code Online (Sandbox Code Playgroud)
在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
...
Run Code Online (Sandbox Code Playgroud)
pip install *.whl)在Windows上工作?如果您知道包名称,例如foo
您可以使用:
python -m pip install --find-links=C:\Users\fredrik\Downloads foo
Run Code Online (Sandbox Code Playgroud)
这会找到任何foo包foo-X.Y.Z-cp37-cp37m-win_amd64.whl等例如...
如果您不知道包名,那么您可以尝试:
FOR %%i in (C:\Users\fredrik\Downloads\*.whl) DO python -m pip install %i
Run Code Online (Sandbox Code Playgroud)