I upgraded my system from python 2 to python 3, and now when I run my code:
from cryptography.hazmat.backends import default_backend
I am getting this error
/usr/local/lib/python3.6/site-packages/paramiko/transport.py:33:
CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python
core team. Therefore, support for it is deprecated in cryptography and will be
removed in a future release.
How to resolve it?
I ran into this issue today and did some digging. Since the os
is not provided I think you could consider one of the options below:
Upgrade your python version. This might be the best option since python 3.6 reached its EOL.
You might be using SSH in your code. Consider installing an older version of paramiko.
You can suppress the warning with these lines of code before importing Paramiko:
import warnings
warnings.filterwarnings(action='ignore',module='.*paramiko.*')
or If you want to be more selective about suppressing JUST that particular deprecation warning:
import warnings
from cryptography.utils import CryptographyDeprecationWarning
warnings.filterwarnings("ignore", category=CryptographyDeprecationWarning)