Install packages into <dir>. By default this will not replace existing files/folders in <dir>. Use –upgrade to replace existing packages in <dir> with new versions.
“.” just means current directory so either command. below will install all objects necessary to use psycopg2
pip install psycopg2 -t . pip install psycopg2 --target .
once you have this you can zip the contents and upload to a lambda layer ( parent dir must be named python and then zip python folder… more detail to come