python3 and pip3 are installed via homebrew. pip3/pip have boto3 installed, and list this module, but it cannot be imported in python3 in scripts
$ # DEBUG INFO
$
$ which python3 pip3
/opt/homebrew/bin/python3
/opt/homebrew/bin/pip3
$
$ python3 --version ; pip3 --version
Python 3.11.6
pip 24.0 from /opt/homebrew/lib/python3.10/site-packages/pip (python 3.10)
$
$ pip3 install boto3
Requirement already satisfied: boto3 in /opt/homebrew/lib/python3.10/site-packages (1.18.36)
Requirement already satisfied: botocore<1.22.0,>=1.21.36 in /opt/homebrew/lib/python3.10/site-packages (from boto3) (1.21.65)
[...]
$
$ pip3 list | grep boto3
pip3 list | grep boto3
boto3 1.18.36
$
$ python3
Python 3.11.6 (main, Nov 2 2023, 04:39:43) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import boto3
import boto3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'boto3'
>>> quit()
python3 --version-> Python 3.11.6.pip3 --version-> pip 24.0 from /opt/homebrew/lib/python3.10 /site-packages/pip (python 3.10)python -m pip installpython3 -m venv .venvthensource .venv/bin/activate- now thepythonandpipcommands will be from the virtual env