2

I want to run some of my python scripts on my new Linux (Centos 6.5) machine that I developed on another Linux machine (also Centos 6.5). But my problem is that my new machine is not having internet connectivity and so I am not able to download all my required modules. Is there a way using which I can simply clone the Python configuration from one machine to another? For example saving image of the python configuration to a pendrive and then installing in new machine using image stored in pendrive? Clone Python from one Linux machine to another? I tried this but it did not work for me.

3
  • 1
    You could probably download the required rpms to the machine that is connected, then copy them over and install on the machine without connectivity. But a better alternative might be to burn some DVDs so you can just install directly from them. Commented Mar 31, 2015 at 11:10
  • how to burn existing python configuration to DVD? Commented Mar 31, 2015 at 11:12
  • You misunderstand. I just meant that you could burn the CentOS DVDs (which contain Centos rpms) and then use them for your machine that is not connected to the net. This would be a lot simpler and better than trying to copy stuff from other machines, which doesn't really make sense, imo. Commented Mar 31, 2015 at 16:04

2 Answers 2

2
  1. Plug a pendrive on the CentOS host that have internet conectivity
  2. Mount the pendrive(depends on your hardware probing). Probably: mount /dev/sdb1 /media
  3. Create a dir inside your media to keep things clean mkdir /media/rpms
  4. Use yum to download the software you want with it's dependencies. Here:

yum install -y --downlaodonly --downloaddir=/media/rpms python

The last argument(packages) will vary depending on what python version you want, and what python modules you have installed on your system that needs to be replicated to the other host.

  1. Plug the usb on the machine with no internet connection, mount the pendrive and use the following command to install all the rpms downloaded: rpm -Uvh *rpm

All steps needs to be executed as root user.

Further Reading

  • nixCraft. How To Download a RPM Package Using yum Command Without Installing On Linux;
  • Ask.Fedora Project. How to install new software offline;
3
  • A big part of the question is what packages to select at step 4. Commented Mar 31, 2015 at 22:30
  • seems good. will try Commented Apr 1, 2015 at 4:24
  • If it is just python, the command line at step 4 should be enough. If it is python3, and python with additional modules/eggs, you will have to add all packages needed. Commented Apr 6, 2015 at 18:04
1

Just copied contents of following directories from machine to another. /usr/lib/python2.6/site-packages and /usr/lib64/python2.6/site-packages. And it worked for me.

5
  • This way you totally broke the meaning of having a package management tool to install things... Commented Apr 6, 2015 at 18:03
  • @nwildner Given that the OP described these were self developed scripts, it is unlikely that they were installed with setup.py let alone with the unnecessary overhead of rpm/yum. Commented Apr 6, 2015 at 18:37
  • Fair enough. But those scripts could be deployed somewhere else, and the python infrastructure installed through packages. It didn't sound clear enough if there are custom scripts inside python libs directory Commented Apr 6, 2015 at 20:02
  • yes i know that it is not a correct way, but it worked for me Commented Apr 8, 2015 at 11:47
  • how ever some i had to install some missing linux dependencies Commented Apr 15, 2015 at 4:42

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.