Python libs on Debian/Raspbian

Gary E. Miller gem at rellim.com
Sat Dec 9 04:18:43 UTC 2017


Yo Hal!

On Fri, 08 Dec 2017 20:00:17 -0800
Hal Murray <hmurray at megapathdsl.net> wrote:

> > Conversely, any plain '/waf install' by user/admin, from our
> > source,=20 should go in a place, that MUST require that location in
> > to be in PYTHONPATH.  
> 
> I thought that people didn't like PYTHONPATH.

Sadly, it is what Python gives us, and tells us to use.  You wanna
get Python, and distros, to change the compromise they made between
themselves, then I suggest you take it up with the Python people.

I'm just trying to do things by the book.

> Richard's local.pth suggestion works (without PYTHONPATH) on Fedora.

Which conflicts with what the book asks for, but may be 100% perfect
for how his .deb eventually works.

> It seemed like an interesting approach.  So I started testing it.

Knowledge is power.

> Let me see if I can summarize:
> 
> We should always install
>   main code to /usr/local/{bin,sbin}/
>   python libraries in /usr/local/lib/pythonX,Y/site-packages/

Or: ~USER/.local/lib/pythonX,Y/site-packages/

That is my reading of where Python wants us to install, by default, for
simple user/admin installs.

> If everybody agrees on that, then all we have to do is figure out how
> to make Python look there.

But you are confusing two issues.

1. how to tell the user how to tell Python to find our installed code

2. making Python find our installed code.


The first is solved by PYTHONPATH, and until it got broken, we used
to tell the user how to do that.

The second, we should never, never, ever do.  By design, the local
dorectories are NOT used by default.  To keep people from totally
destroying their systems.

> PYTHONPATH does that.  So does local.pth on Fedora.

Does what?  #1 or #2?  No distro wants us to do #2.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20171208/014943d9/attachment.bin>


More information about the devel mailing list