Why should I install Python packages into `~/.local`?

前端 未结 2 1928
有刺的猬
有刺的猬 2021-01-03 06:11

Background

  1. I don\'t develop using OS X\'s system provided Python versions (on OS X 10.6 that\'s Python 2.5.4 and 2.6.1).
  2. I don\'t install anything
相关标签:
2条回答
  • 2021-01-03 06:43

    There's no particularly good reason for or against installing in .local for Mac OS X installations using framework builds. There is still some controversy among Python core developers on this point with Glyph arguing that the .local location, introduced in Python 2.6 for other Unixy systems, should be used for Mac OS X and simplifies third-party installation processes, while others argue that the previous traditional locations for Mac OS X framework builds is more natural. In the end, it is up to you. Particularly if you are using virtual environments, if it works, don't worry about it.

    0 讨论(0)
  • 2021-01-03 07:01

    As of 2020, I do not think it is a good idea to install Python packages into .local, but to use virtualenv to create a separate environment for each package.

    My reason

    While installations into .local do not interfere with the system wide Python, you still can have conflicts between several packages installed into .local.

    P.S.: If you do you like virtualenv you could also use pipx.

    0 讨论(0)
提交回复
热议问题