On a project I'm involved with, we package our python product using compileall.compile_dir on an Ubuntu 14.04 (using Python 3.4). The directories of pyc files and such are bundled (tar.gz file) and distributed. The filenames are altered to remove the cpython-34 part of the filename.
We have a new test environment running Ubuntu 16.04 which has Python 3.5 and would like to run/test the code. When we unpack it and run it, we get an error :
$ ./configure
/usr/bin/python3: can't find '__main__' module in '/home/user/product/configure.pyz'
If I manually unpack the pyz file and attempt to run the python from the command line, after importing things, I get a message about it being a 3.4 binary. If I, instead, build the package on the 3.5 machine, I can totally run it on the 3.5 machine, but when I copy to 3.4, I get the same error.
Question is... what do I need to do to run/test it? Ideas I've had... running 3.5 in some sort of 3.4 compatibility mode. Install 3.4 (probably from source because I can't find a 3.4 package for Ubuntu 16.04). Maybe adjust some 3.5 config settings? Maybe provide a new setting when packaging to allow 3.4 and 3.5 to work? I assume I've missed some ideas, but I don't want to ask about what I think the solution is, I would like to know what the solution is.
Having googled and found a bunch of SO issues relating to pyc files, I know that the 3.4 files are not compatible, but are there ways to use it?