How to install Python packages from the tar.gz file without using pip install

前端 未结 7 896
甜味超标
甜味超标 2020-11-27 10:26

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.

相关标签:
7条回答
  • 2020-11-27 10:32

    For those of you using python3 you can use:

    python3 setup.py install
    
    0 讨论(0)
  • 2020-11-27 10:35

    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 by pushd C:\Users\absolutefilepathtotarunpackedfolder
    • Then run python setup.py install

    Thanks Tales Padua & Hugo Honorem

    0 讨论(0)
  • 2020-11-27 10:37

    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.

    0 讨论(0)
  • 2020-11-27 10:39

    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
    
    0 讨论(0)
  • 2020-11-27 10:41

    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.

    0 讨论(0)
  • 2020-11-27 10:41

    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

    0 讨论(0)
提交回复
热议问题