I have installed Python 3.7.5 on MacOS 10.14.6 from brew (brew install python). brew info python
shows:
You can install Python packages with
pip3 install
They will install into the site-package directory
/usr/local/lib/python3.7/site-packages
But when I trying install boto3 pip package (actually name of package no matter, it’s issue with any) see this error:
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/lib/python3.7'
Consider using the `--user` option or check the permissions.
I tried figure out where pip get ‘/lib/python3.7’ lib, because python itself shows site-packages is another directory:
python3 -c “import site; print(site.getsitepackages())”
[‘/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages’]
And also this directory not listed here:
python3 -m site
sys.path = [
‘/usr/local/lib/python3.7/site-packages’,
‘/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python37.zip’,
‘/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7’,
‘/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload’,
‘/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages’,
]
Please help determine a way how pip determine where packages should be installed.