Search code examples
pythonpython-3.xpython-cryptography

CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team


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?


Solution

  • 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:

    1. Upgrade your python version. This might be the best option since python 3.6 reached its EOL.

    2. You might be using SSH in your code. Consider installing an older version of paramiko.

    3. 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)
    

    source for option 3

    1. Check if you installed it using pip when you needed to use conda.