Python ssl module - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Python ssl module (/thread-42375.html) |
Python ssl module - Pedroski55 - Jun-27-2024 If I open Idle, I can import the module ssl no problem But Quote:pip list in bash shows no module ssl Why does ssl not show up in the list, but can be imported without an error message? After importing ssl in Idle, this command print(ssl.__version__)just shows: I want to know what version of module ssl I have and if it can be updated, because I have an error when trying to send an email using Python via gmail. Sending via QQ everything works:Quote:pedro@pedro-HP:~/babystuff/forAgro/python$ ./send_1_email_via_Pilar_gmail_no_attachment_V1.py I thought I could just run pip install ssl If the version I have is the latest, I usually just get a message to that effect. But pip tries to get and unpack a .tar.gz file, and that has a problem, which I have shortened here: Quote:pedro@pedro-HP:~/babystuff/forAgro/python$ pip3 install ssl Very grateful for any tips or advice! RE: Python ssl module - Larz60+ - Jun-27-2024 for version number: >>> print(ssl.OPENSSL_VERSION) >>> 'OpenSSL 3.0.2 15 Mar 2022'to get a List of all ssl commands: >>> import ssl >>> xx = dir(ssl) >>> for item in xx: ... print(item) ... RE: Python ssl module - Pedroski55 - Jun-27-2024 Thanks! I get: Doesn't seem so old!
RE: Python ssl module - Larz60+ - Jun-27-2024 see: https://docs.python.org/3/library/ssl.html It looks like a lot of waht was in 3.10 has been depreciated. RE: Python ssl module - Pedroski55 - Jun-28-2024 The morning always brings light! Trying again with gmail again, I changed to port 587 and used: server.starttls(context=context) context = ssl.create_default_context() server = smtplib.SMTP(smtp_server, port) server.starttls(context=context) server.login(sender_email, password)For this kind of login you need an app password. When I removed the spaces from the app password, I also deleted 1 letter, so it was wrong! You don't need to remove the spaces from the app password either!! Now this works smoothly with gmail, yahoo and QQ, straight from bash! I wonder if the gf will be happy?? |