Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install python from source without internet connection?

I'm installing python on custom location on a internal server. Unfortunately, I can't make full internet connection here. Most of sites are block by firewall. (essentially pypi repository!) Please don't ask the reason. And I don't have root account, so I have to install python from source. I did install python from source successfully! But the problem is any of easy_install or pip is not installable because the sites are not accessible form here. :(

How can I install them under current situation?

like image 485
eonil Avatar asked Jan 06 '12 07:01

eonil


People also ask

How do I install Python without internet?

Solution in Brief. As the solution we downloaded the required Python package and its dependencies from the PyPI and put them in a local folder location and installed them using 'pip' by instructing 'pip' to look for the packages in the local folder location instead of the PyPI.

How do I install setuptools without internet?

download wheel file . whl file :like to the wheel file. then open terminal(as admin) and go to the directory which your whl file exists. type : pip install {name of your setuptools}.


1 Answers

  1. Download the source tarballs of the module you are interested in to your PC
  2. Upload it to the remote server (SCP)
  3. Extract the tarball (eg. tar -xvzf pack.tar.gz)
  4. Set the current directory to the extracted folder (should contain a file named setup.py)
  5. Install the module: python setup.py install (See documentation)

In my eyes setting up a local mirror like proposed by Tim is not worth of it (Of course this depends on how often you plan to install/update Python modules on that remote machine...)

like image 125
gecco Avatar answered Sep 21 '22 09:09

gecco