6

I am using Anaconda environment with python 3.7 set up. I am trying to send a simple email via my gmail account using smtplib and I am getting "No SSL support included in this python" I do realize this question has been asked a number times but I can't find concrete suggestions on how to add ssl support in my anaconda/python environment. I installed openssl and pyopenssl, but no luck.

Here is my code:

import smtplib
from email.message import EmailMessage

msg = EmailMessage()
msg['Subject'] = 'test'
msg['From'] = 'xxxx@gmail.com'
msg['To'] = 'xxxx@gmail.com'

server = smtplib.SMTP('smtp.gmail.com:587')
server.ehlo()
server.starttls()
server.login('xxxx@gmail.com','xxxxx')
server.send_message(msg)
server.quit()

Again my environment is:

Anaconda python 3.7 running on Windows 10 pycharm is the IDE

Edit: Here is the output of my conda list and conda info

(py37) C:\Users\kspoo>conda list
# packages in environment at C:\Users\kspoo\Anaconda3\envs\py37:
#
# Name                    Version                   Build  Channel
asn1crypto                0.24.0                    <pip>
ca-certificates           2018.03.07                    0    anaconda
certifi                   2018.10.15               py37_0    anaconda
cffi                      1.11.5                    <pip>
cryptography              2.4.2                     <pip>
idna                      2.7                       <pip>
openssl                   1.1.1                he774522_0    anaconda
pip                       18.1                     py37_0
pycparser                 2.19                      <pip>
pyOpenSSL                 18.0.0                    <pip>
python                    3.7.1                he44a216_5
setuptools                40.6.2                   py37_0
six                       1.11.0                    <pip>
vc                        14.1                 h21ff451_3    anaconda
vs2015_runtime            15.5.2                        3    anaconda
wheel                     0.32.3                   py37_0
wincertstore              0.2                      py37_0

(py37) C:\Users\kspoo>conda info

     active environment : py37
    active env location : C:\Users\kspoo\Anaconda3\envs\py37
            shell level : 2
       user config file : C:\Users\kspoo\.condarc
 populated config files : C:\Users\kspoo\.condarc
          conda version : 4.5.11
    conda-build version : 3.15.1
         python version : 3.7.0.final.0
       base environment : C:\Users\kspoo\Anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/win-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/win-64
                          https://repo.anaconda.com/pkgs/pro/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\kspoo\Anaconda3\pkgs
                          C:\Users\kspoo\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\kspoo\Anaconda3\envs
                          C:\Users\kspoo\AppData\Local\conda\conda\envs
                          C:\Users\kspoo\.conda\envs
               platform : win-64
             user-agent : conda/4.5.11 requests/2.19.1 CPython/3.7.0 Windows/10 Windows/10.0.17134
          administrator : False
             netrc file : None
           offline mode : False


(py37) C:\Users\kspoo>

Thanks, Kelvin

Kelvin Poon
  • 79
  • 1
  • 6

3 Answers3

10

Please provide the output from conda list and conda info. We have a thread going on GitHub.

In the meantime, you can try downgrading to the previous build with conda install python=3.7.1=h33f27b4_4.

kne42
  • 126
  • 1
  • 3
  • 2
    I just ran into this problem with a 32 bit miniconda install on Windows. The "in the meantime" worked. – Tim Richardson Dec 04 '18 at 11:59
  • just installed miniconda here but the in the meantime did not work, I still get SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/main/win-64/repodata.json.bz2 (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))')) – Newtopian Jan 07 '19 at 23:07
  • Downgrading to miniconda4.5.11 worked for me (https://repo.anaconda.com/miniconda/). Conda updated back to 4.5.12 at the first successful update, updating certifi cleanly along the way. – Tugrul Ates Jan 13 '19 at 05:53
2

A simple fix is to open Anaconda Prompt in admin mode and run your commands there. It works without any hassle.

0

i was using Anaconda in windows with pycharm ide.i was gerring the error as:

This python installation has no SSL support.

So i downgraded my python version to 3.6 and it worked.