If the systems are similar, like you indicated in your comments, then this is quite possible to do. What you are likely to miss is
/usr/local/lib/python2.7, and the files beneath that—if you copied the executable python2.7 from
/usr/bin then most likely the former, if copied from
/usr/local/bin most likely the latter.
You can specify configuration options when compiling Python on Linux for many parts (
--bindir for executable,
--mandir man pages, etc.), but most likely you did not specify any and just did
./configure before running
If your run
./configure --help you can see what the default value for
--prefix is, the rest is relative to that, but other files will be there as well.
To find out everything you can touch all of the source, compile and install and
find (starting with the default directory for
--prefix option), anything installed the last X minutes.
You could also recompile to a specify unused directory by specifying
configure, that way there will be no other files than those you need to copy:
make clean # might fail ignore
sudo make install
After that you can tar up everything under
/opt/py272 (assuming there was nothing there before you started the compilation) and copy it to the target system and extract things to
On the target system you can also link
/opt/py272/bin/python so you can use the line
#! /usr/bin/env python27 atop your 2.7.2 specific scripts.
In all of this you need to know you are not free to move files around from the location specified at configuration time, as some paths are compiled into the executable/libraries, but you can link to the executable from a sensible place (some directory in your