gpt4 book ai didi

python-3.x - "No SSL support included in this python" python -python3-smtplib

转载 作者:太空宇宙 更新时间:2023-11-03 12:44:15 27 4
gpt4 key购买 nike

我正在使用设置了 python 3.7 的 Anaconda 环境。我正在尝试使用 smtplib 通过我的 gmail 帐户发送一封简单的电子邮件,但我收到“此 python 中不包含 SSL 支持”我确实意识到这个问题已被问过很多次,但我找不到关于如何添加的具体建议我的 anaconda/python 环境中的 ssl 支持。我安装了 openssl 和 pyopenssl,但没有成功。

这是我的代码:

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()

同样,我的环境是:

python python 3.7在 Windows 10 上运行pycharm 是集成开发环境

编辑:这是我的 conda list 和 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>

谢谢,开尔文

最佳答案

请提供 conda listconda info 的输出。我们有一个 thread going on GitHub .

同时,您可以尝试使用 conda install python=3.7.1=h33f27b4_4 降级到以前的版本。

关于python-3.x - "No SSL support included in this python" python -python3-smtplib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53541815/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com