Is it possible to install a Python wheel without using pip
? I always have issues with installing with pip
, so I usually install libraries manually by copying and pasting. I'm wondering if there is a way to do wheel files in a similar manner.

- 1,304
- 3
- 23
- 43
2 Answers
I'm assuming you have internet access, but you don't have a working pip installation.
Download the pip wheel:
$ wget https://files.pythonhosted.org/packages/50/c2/e06851e8cc28dcad7c155f4753da8833ac06a5c704c109313b8d5a62968a/pip-23.2.1-py3-none-any.whl
To find the url of a release in the first place, you can get the index json endpoint. For example:
$ curl -s https://pypi.org/pypi/pip/json | jq ".urls[0].url"
"https://files.pythonhosted.org/packages/50/c2/e06851e8cc28dcad7c155f4753da8833ac06a5c704c109313b8d5a62968a/pip-23.2.1-py3-none-any.whl"
For users not scripting this but just doing once-off, you may prefer to simply download a pip wheel using your browser. In that case, look for the latest release files here:
https://pypi.org/project/pip/#files
Now you have a wheel for pip, and some other wheel file you want to install. You can actually "execute" the pip wheel file to install the other wheel file. For example, if you were trying to install setuptools v68.0.0 from a wheel file without internet access, the command would look like this:
$ python pip-23.2.1-py3-none-any.whl/pip install --no-index setuptools-68.0.0-py3-none-any.whl
Processing ./setuptools-68.0.0-py3-none-any.whl
Installing collected packages: setuptools
Successfully installed setuptools-68.0.0
You will now have a working setuptools installation, even with no pip installation.
In case you were wondering, yes you can use the same trick to install pip itself. That command would look like this:
$ python pip-23.2.1-py3-none-any.whl/pip install --no-index pip-23.2.1-py3-none-any.whl
And now you should have a working pip installation, associated with whichever interpreter this python
executable is pointing at.

- 338,267
- 99
- 616
- 750
-
1Download the pip wheel you say! But how to find it? And what about the second wheel - for setuptools? They exist, I know - that is what cpython includes in ensurepip. But finding them? Not so easy imho. No down vote (might not even be able to considering my status here ;) - but imho - only half an answer. – Michael Felt May 13 '18 at 10:31
-
@MichaelFelt OK, I've added the instruction for how to automate finding the download url from index. – wim May 13 '18 at 14:17
-
muchas gracias! What I was looking for! - except, seems I also need a new command (jq). Anyway, I can dig. Thx! – Michael Felt May 13 '18 at 15:51
-
A convenient way to download wheels for packages is by using `pip download` command with `--only-binary=wheel` specifier, e.g. `pip download --only-binary=wheel pip`. – east825 Feb 22 '20 at 17:01
-
1The trick with executing the command from the wheel file is just awesome. – hoefling Jun 02 '20 at 17:59
-
Be careful with just downloading the latest pip in scripts. From time to time pip drops support for older python versions, so you might be surprised. – yurez Oct 22 '20 at 12:53
-
@yurez Good point. The json api can also tell you the supported versions: `curl -s https://pypi.org/pypi/pip/json | jq ".urls[0].requires_python"` and the installer will abort with a useful error message if attempting to install wheel with an unsupported python runtime. – wim Oct 22 '20 at 19:06
-
it's really aswesome – Bhanu Surendra Apr 28 '21 at 08:47
-
1@wim I get this error: C:\Users\user1\AppData\Local\Programs\Python\Python310\python.exe: can't find '__main__' module in 'C:\\Users\\user1\\Downloads\\pip-10.0.1-py2.py3-none-any.whl\\pip' – Kovy Jacob Apr 25 '22 at 06:34
It is. Actually .whl files are just zip archives, so you can just extract their content and play with libraries path variable to make it work. Yet it is really bad practice.
-
play with libraries path variable to make it work ?? Can you give the cmd line of code to execute ? – PySaad Jan 09 '18 at 07:01
-
1@Code_10 check this article https://leemendelowitz.github.io/blog/how-does-python-find-packages.html – Jan 09 '18 at 10:08
-
1If you don't know where you should unzip it, you can look at the python path like this: `import sys; print(sys.path)` – guettli May 03 '18 at 10:54
-
You can also simply throw the folder with the contents into whatever your default python libraries path is (/lib/
/site-packages/ usually). Again, quite the ugliness to do. – mirh Aug 29 '19 at 20:09 -
2
-
I can elaborate - this will **not** correctly install a wheel distribution. It is also the job of the installer to compile .py files into .pyc files, and also to write out any console scripts entry points to bin dir. These files don't actually exist in the .whl, so if you just unzip a wheel you won't get those and the installation is incomplete. – wim Aug 04 '20 at 17:26
-
Instead of changing something in variables you can copy extracted library folders (i.e. pure library folders, where the code is) to the user-site folder, as told in this answer: https://stackoverflow.com/a/16196400/8366223 – PolyGlot Dec 06 '20 at 13:02