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.
This question is related to
python
installation
packages
For those of you using python3 you can use:
python3 setup.py install
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.
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.
If you don't wanted to use PIP install atall, then you could do the following:
1) Download the package 2) Use 7 zip for unzipping tar files. ( Use 7 zip again until you see a folder by the name of the package you are looking for. Ex: wordcloud)
3) Locate Python library folder where python is installed and paste the 'WordCloud' folder itself there
4) Success !! Now you can import the library and start using the package.
Is it possible for you to use sudo apt-get install python-seaborn
instead? Basically tar.gz is just a zip file containing a setup, so what you want to do is to unzip it, cd to the place where it is downloaded and use gunzip -c seaborn-0.7.0.tar.gz | tar xf -
for linux. Change dictionary into the new seaborn unzipped file and execute python setup.py install
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
Source: Stackoverflow.com