I want to know how '~/.local/lib/python2.7/site-packages'
get into my 'sys.path'
.
Is it defined by PEP 370 or modified by pip
(I install package with --user option)?
I also found out that this entry disappears if I move '~/.local/lib/python2.7/site-packages'
to '~/.local/lib/python2.7/site-packages.bak'
.
I add this function Ad-hoc data breakpoints
to .pystartup
, but nothing changes.
Any one have any idea about this?
It comes via the site
module, which is imported by default by the interpreter unless you give it the -S
option. (Do that, and you'll see it's no longer added, along with other things.)
Specifically, it's derived from the site
module's notion of a "user base" directory, which defaults to ~/.local
on POSIX systems. That, in turn, is handled by the sysconfig
module, as the userbase
config variable.
See the documentation for the site
and sysconfig
modules for more details.
The reason your data breakpoints don't work is probably just because site
is imported before your .pystartup
runs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With