Background/Situation
The client is operating in an air-gapped environment where the Linux server does not have internet access. They require guidelines for the offline installation of necessary Python packages, system libraries, and PyCharm plugins.
Question
How to perform offline installation of Python packages, system libraries, and PyCharm plugins on a Linux server without internet connectivity?
Answer
Offline Installation of Python System Packages (e.g., tkinter)
-
Use a machine with internet access:
- Ensure the machine matches the OS version of the offline server.
-
Download the required OS packages and dependencies:
apt-get download python3-tk -
Transfer the downloaded
.debfiles to the offline server:- Use a USB drive or any offline transfer mechanism.
-
Install the packages on the offline server:
sudo dpkg -i *.deb sudo apt-get -f install- Note: Commands differ depending on the OS and package manager. For RPM-based distributions, use
yumordnfinstead ofapt-get.
- Note: Commands differ depending on the OS and package manager. For RPM-based distributions, use
Offline Installation of Python Packages Using pip
-
Download required Python packages and dependencies on an online machine:
pip download <package-name> -d ./offline_packagesExample:
pip download numpy requests -d ./offline_packages -
Transfer the
offline_packagesdirectory to the offline server. -
Install the packages on the offline server:
pip install --no-index --find-links=./offline_packages <package-name>Example:
pip install --no-index --find-links=./offline_packages numpy requests- Reference: pip offline installation documentation.
Offline Installation of PyCharm Plugins
-
Download the plugin
.zipfile on an online machine:- Visit the JetBrains Plugin Repository and download the required plugin.
-
Transfer the
.zipfile to the offline server. -
Install the plugin in PyCharm:
-
Open PyCharm.
-
Navigate to Settings Plugins ⚙ Install Plugin from Disk.
-
Locate and select the
.zipfile. -
Reference: Installing Plugins from Disk.
-
These methods provide a comprehensive guide for offline package installation in compliance with air-gapped or isolated environments.
Comments
0 comments
Please sign in to leave a comment.