如何在ubuntu os中安装python smtplib模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31796174/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install python smtplib module in ubuntu os
提问by vijay
I tried to install python module via pip, but it was not successful. can any one help me to install smtplib python module in ubuntu 12.10 OS?
我尝试通过 pip 安装 python 模块,但没有成功。有人可以帮我在 ubuntu 12.10 操作系统中安装 smtplib python 模块吗?
回答by Tahseen
I will tell you a probable why you might be getting error like Error no module smtplib
我会告诉你一个可能的原因,你可能会收到像 Error no module smtplib 这样的错误
I had created program as email.py
我已经创建了作为 email.py 的程序
Now email is a module in python and because of that it start giving error for smtplib also
现在电子邮件是 python 中的一个模块,因此它也开始为 smtplib 提供错误
then I had to delete email.pyc file created and then rename email.py to mymail.py
然后我不得不删除创建的 email.pyc 文件,然后将 email.py 重命名为 mymail.py
After that no error of smtplib
之后smtplib没有错误
Make sure your file name is not conflicting with the python module. Also see because of that any *.pyc file created inside the folder
确保您的文件名与 python 模块不冲突。也看到因为在文件夹内创建的任何 *.pyc 文件
回答by Solar.gy
smptlib
is part of python's standard library, so you do not have to install it.
smptlib
是python 标准库的一部分,所以你不必安装它。