Python: fixing ‘CryptographyDeprecationWarning: Blowfish has been deprecated’

python-logoIf you are getting a warning similar to below when running a Python3 application:

/usr/lib/python3/dist-packages/paramiko/transport.py:219: CryptographyDeprecationWarning: Blowfish has been deprecated

This can be resolved by upgrading to the latest paramiko module.

# check current version then upgrade
pip3 show paramiko
pip3 install paramiko --upgrade

# check upgraded version
pip3 show paramiko

In my case, this upgraded paramiko to 3.1.0 and the warning was no longer thrown.

REFERENCES

github issue in paramiko project

github issue in pgcli project