Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 497
Kanhaiya Singh Avatar asked Apr 22 '26 05:04

Kanhaiya Singh


2 Answers

on ubuntu

sudo apt-get upgrade docker-compose

docker-compose must be 2.X after that you need to refer old command to new command so do this

alias docker-compose='docker compose'
like image 159
Ali Bildir Avatar answered Apr 24 '26 17:04

Ali Bildir


One of the solutions here suggests using

from cryptography.utils import CryptographyDeprecationWarning

That didn't work in my case, since importing the warning object caused the warning itself as well.

Although it's not an elegant solution (since "elegant" would be to upgrade Python), the following worked for me instead:

warnings.filterwarnings(action='ignore',message='Python 3.6 is no longer supported')
like image 44
01drich Avatar answered Apr 24 '26 17:04

01drich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!