I have a dev Linux server (RHEL) which doesn't have any internet connectivity where we need to develop a python application. I can connect to this dev box from my local Windows server where I have internet connection.
I would need to install python-3.75 and some other packages (some of which need gcc compilers and other dependencies) on this dev box.
What is the best way to do this considering that some packages will have many dependencies and there is no internet on the dev box ?
Some options that the internet research suggests for package installation are:
Download the packages using PIP DOWNLOAD on the local server > copy the package tar to the dev server >
pip install package
download and unpack the source distribution > using the setup.py file of the package: run
python setup.py install --user
Install using Wheels: Find the wheel for the package > upload it to the dev server > run
pip install SomePackage.whl
Please let me know which one of these is good considering the limitations and kindly suggest if there is any other option as well.
Its kinda late but for those who may need it:
To start installing we need a virtual online server to download and configure file. You can use VMware or VirtualBox to go through this procedure. Steps below are the ones that you should do on server with internet connection.
First, we go to https://www.python.org/downloads/source/ and find our required version of python and download Gzipped source tarball of it.
Then we copy downloaded file to our target machine. You can copy using command below.
scp file username@ipaddress:dir
Then go to your specified dir and make sure the file has copied successfully. Now you can unzip the file using command below:
Tar -xvf file_name
Now go to unzipped folder which has configure file in it. And run command below:
./configure
This step needs internet connection.
Step 4 should create some files including make files. Now in your current directory run command below:
make
After having make process, go back to your previous directory and zip the directory which has make files in it. You can zip using command below:
tar -czf
We are going to copy this file to our target machine which doesn’t have internet connection.
Now you can go to your target machine and directory that you copied zipped file and it’s time to unzip your file using tar command. Once you unzipped your file go to your directory which has make files in it and run command below:
it should begin to install Python with its dependencies. You can type python3.8 –version to make sure that your python is installed. (Instead of 3.8 type your own version)