gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] Python Shebang Lines


From: Fred Wright
Subject: Re: [gpsd-dev] Python Shebang Lines
Date: Wed, 28 Dec 2016 19:31:54 -0800 (PST)

On Wed, 28 Dec 2016, Sanjeev Gupta wrote:
> On Wed, Dec 28, 2016 at 6:14 AM, Fred Wright <address@hidden> wrote:
>
> > I'd like to reraise the issue of shebang lines in Python programs.  To
> > review, the problem is as follows:
> >
>
> Let me try and phrase what I understand from Fred's email.
>
> I shall ignore python3 for creating a simple test case.
>
> Assume, at build and install time, the python version in use (by Scons,
> etc) is 2.7.  Then, the libraries are installed to /usr/lib/python2.7
[...]
> If, at run time, python 2.8 is being used, these will not be found.  The
> runtime interpreter will look for files in /usr/lib/python2.8.
>
> Fred, am I right so far?

Basically yes, though the particular location varies with the platform and
is often buried within the tree of the relevant Python interpreter.  E.g.:

MacPro:~ fw$ python -c 'from distutils import sysconfig; print 
sysconfig.get_python_lib()'
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages

Part of the reason for that is to allow multiple Pythons of the same
nominal version number to coexist.  E.g. (on the same system as above):

MacPro:~ fw$ /usr/bin/python -c 'from distutils import sysconfig; print 
sysconfig.get_python_lib()'
/Library/Python/2.7/site-packages

And of course there's no Python 2.8 (nor will there ever be), but the
specific version numbers don't matter.

> This has nothing to do with the python2 vs python3 issue.

Indeed, though python2 vs. python3 adds *additional* issues with compiled
extensions even when the libraries *are* found.

Fred Wright



reply via email to

[Prev in Thread] Current Thread [Next in Thread]