Installation location for python code, tools, etc.
jmr at macports.org
Sun Jan 2 22:17:52 UTC 2022
> I'm not very experienced with Python, yet, but with regard to MacPorts,
> I'm trying to understand why when I do a pip3 install, or a direct
> install from a project tree ie: "python setup.py install" the tool(s)
> end up in this directory instead of /opt/local/bin|sbin etc:
Python is typically built as a framework on macOS, so that's where the
modules go. See
Python 3.9.9 (main, Nov 16 2021, 17:57:38)
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
Pip has a number of options controlling where things are installed:
I strongly recommend not installing modules into the MacPorts prefix
with pip (or manually), because modules installed in other ways will
conflict with modules installed by MacPorts. Install in a venv, or use
pip's --user option or some completely separate prefix.
More information about the macports-users