How to install Python packages from the tar.gz file without using pip install
Solution 1
Thanks to the answers below combined I've got it working.
- First needed to unpack the tar.gz file into a folder.
- Then before running
python setup.py install
had to point cmd towards the correct folder. I did this bypushd C:\Users\absolutefilepathtotarunpackedfolder
- Then run
python setup.py install
Thanks Tales Padua & Hugo Honorem
Solution 2
You may use pip
for that without using the network. See in the docs (search for "Install a particular source archive file"). Any of those should work:
pip install relative_path_to_seaborn.tar.gz
pip install absolute_path_to_seaborn.tar.gz
pip install file:///absolute_path_to_seaborn.tar.gz
Or you may uncompress the archive and use setup.py
directly with either pip
or python
:
cd directory_containing_tar.gz
tar -xvzf seaborn-0.10.1.tar.gz
pip install seaborn-0.10.1
python setup.py install
Of course, you should also download required packages and install them the same way before you proceed.
Solution 3
You can install a tarball without extracting it first. Just navigate to the directory containing your .tar.gz
file from your command prompt and enter this command:
pip install my-tarball-file-name.tar.gz
I am running python 3.4.3 and this works for me. I can't tell if this would work on other versions of python though.
Solution 4
Install it by running
python setup.py install
Better yet, you can download from github. Install git via apt-get install git
and then follow this steps:
git clone https://github.com/mwaskom/seaborn.git
cd seaborn
python setup.py install
Solution 5
For those of you using python3 you can use:
python3 setup.py install
Related videos on Youtube

yenoolnairb
Updated on August 01, 2022Comments
-
yenoolnairb 5 months
Long story short my work computer has network constraints which means trying to use
pip install
in cmd just leads to timing out/not finding package errors.For example; when I try to
pip install seaborn
:Instead I have tried to download the tar.gz file of the packages I want, however, I do not know how to install them. I've extracted the files from the tar.gz file and there is a "setup" file within but it's not doing much for me.
If someone could explain how to install python packages in this manner without using
pip install
on windows that would be amazing. -
yenoolnairb almost 7 yearsThis gives the following error:
You must give at least one requirement to install (maybe you meant "pip install file:///absolute path.."?)
-
yenoolnairb almost 7 yearsand I have actually entered the path in case you're wondering!
-
yenoolnairb almost 7 years
No such file or directory
This could be to do with the setup of my files and folders. Python isn't gonna be in the default place Python would normally install -
Deusdeorum almost 7 yearsOkey, so he could use another unzipper like 7-zip, it's pretty irrelevant what unzipper he uses..
-
Tales Pádua almost 7 yearsunpack from tar, go to the folder where the setup.py is, and then run the command above
-
yenoolnairb almost 7 yearsDo I need to amend the code above to point it directly to where the unpacked tar is? Cos I'm still getting
no such file or directory
-
Deusdeorum almost 7 yearsmight be, anyhow, the instructions are: unzip the folder -> change dictionary in your command line into that folder -> execute
python setup.py install
-
Tales Pádua almost 7 yearsUnpack the tar.gz to somewhere. Then, from the terminal, go to the folder where you extracted it. You need to be on the folder where setup.py is, and then run this command
-
yenoolnairb almost 7 yearsUnfortunatley github is blocked on my work computer!! I've got it working now though; thanks
-
Tales Pádua almost 7 yearsCan you edit the PATH variables of your machine? If so, you can add python to it, and use python anywhere without need to use pushd
-
Jérôme almost 7 yearsYou can also use pip + git but I assumed network issues ruled out this option.
-
Sнаđошƒаӽ over 6 yearsActually you don't have to extract the tar.gz file to install it. Take a look at my answer
-
Magic_Matt_Man almost 6 yearsRunning this on python 3.4.3 and pip 9.0.1 I get an error relating to a temp file:
[Errno 2] No such file or directory: '/tmp/pip-anjip21-build/setup.py
running on Jessie (raspberry pi 3) -
Hawkins over 4 yearsIf you can download on another machine and bring them over, it's possible to download each dependency you need and install them in this manner in such an order that the desired package has all dependencies met and does not need a network connection anymore. I.e.,
A
depends onB
. So installB
, thenA
. -
Sнаđошƒаӽ almost 4 years@Magic See the examples in official docs. So it should work. From the error message you showed it seems the tarball you are trying to install isn't following proper file naming conventions.
-
adin over 3 yearsThis works perfect for situations where using pip generates
error(10054, 'An existing connection was forcibly closed by the remote host')
-
Lev over 3 yearspip install *.tar.gz will install all the packages in the directory... just trying to help:)
-
Bill Wallis over 1 yearI was getting a whole host of different errors using the other solutions -- this was the only solution that worked for me