简体   繁体   中英

user site-package directory

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM