13

For some reason, I cannot pip install %CD%\*.whl as I will then get:

Requirement 'C:\\Users\fredrik\\Downloads\\*.whl' looks like a filename, but the file does not exist
`*.whl is not a valid wheel filename.

On macOS (and I believe on Linux), I can do this without issues:

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
...

  1. Why is there a difference in this behavior between the platforms?
  2. Is there a preferred way to make this (pip install *.whl) work on Windows?
1

1 Answer 1

18

If you know the package name e.g. foo You can use this:

python -m pip install --find-links=C:\Users\fredrik\Downloads foo

this will find any foo package e.g. foo-X.Y.Z-cp37-cp37m-win_amd64.whl etc...

If you don't know the package name then you can try to loop through all wheels:

FOR %i in (C:\Users\fredrik\Downloads\*.whl) DO python -m pip install %i

note: in a batch script you must use FOR %%i instead (and keep %i at the end).

Sign up to request clarification or add additional context in comments.

1 Comment

If you already have a terminal in the desired directory, you can use pip install --find-links=. foo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.