On Ubuntu, even though I had OpenSSL installed via pip, the following fixed the dependency issue:
sudo apt install python3-openssl --reinstall