Copying a compiled Python from one system to another

Steve D'Aprano steve+python at pearwood.info
Sat Oct 1 09:03:39 EDT 2016


On Sat, 1 Oct 2016 10:01 pm, Chris Angelico wrote:

>> [...] I thought I could
>> compile 3.6 on this VM, then copy the python binary to my usual desktop
>> machine.
>>
>> What sort of challenges am I likely to find? Both machines are Linux, but
>> different distros.
> 
> First off, are they the same CPU architecture? 

I'll say yes.


> Are both Linuxes of broadly similar vintage? 

That depends on what you mean by "broadly similar". As far as I am
concerned, a five year difference is not very much, and is broadly
similar -- it's not like I'm using Linux from 1991. But the whole point is
that I need something with gcc 4.8 (maybe 4.7 will do, not sure) but
certainly not 4.4 which is the most recent I can get on my current systems.



> The most likely problems 
> you'll face will be library versions - CPython will happily link
> against any of several compatible versions of a library, but once it's
> linked against one, it'll want to find the same version thereafter.
> Worst case, you could symlink, but that could cause trouble when you
> upgrade, so I'd advise against it.

Does gcc support static linking? Even if I end up with a much bigger binary,
at least I know it will have everything it needs to run and I won't have to
deal with DLL hell.




-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list