Creating a secondary site-packages directory (and loading packages from .pth files therein)

前端 未结 2 1369
轮回少年
轮回少年 2020-12-30 01:24

I would like to install some packages into a third-party site-packages directory (beyond the standard system locations). Is there any way to set this up such th

2条回答
  •  隐瞒了意图╮
    2020-12-30 01:49

    There was PEP 370 specifically addressing the creation of per-user site-packages directories, to deal with the situation where the user has no admin access to the system-wide site-packages.

    For example on Unix (including Mac OS), and assuming one is using Python 3.6, one can create the following directory and place .pth files inside there

    ~/.local/lib/python3.6/site-packages

提交回复
热议问题