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

前端 未结 7 898
甜味超标
甜味超标 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: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.

提交回复
热议问题