kootenpv / yagmail

Send email in Python conveniently for gmail using yagmail
MIT License
2.64k stars 263 forks source link

Problem when send email, any idea to fix it ? #186

Open lamhoson opened 3 years ago

lamhoson commented 3 years ago

Error is: No module named 'premailer'

Python 3.7.9

yag.send(to="deta01@gmail.com", subject='subjectMsg', contents='body' )

lamhoson commented 3 years ago

When try to install the premailer seperately:

Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort. Examining python=3.7: 20%|██████████████████████████ | 1/5 Examining @/win-64::win==0=0: 40%|████████████████████████████████████████████████▍ Examining @/win-64::win==0=0: 60%|████████████████████████████████████████████████████████████████████████▌ Examining premailer: 60%|███████████████████████████████████████████████████████████████████████████████▏ Examining @/win-64::cuda==10.2=0: 80%|██████████████████████████████████████████████████████████████████████████Examining @/win-64::cuda==10.2=0: 100%|██████████████████████████████████████████████████████████████████████████failed

UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment:

Specifications:

Your python: python=3.7

If python is on the left-most side of the chain, that's the version you've asked for. When python appears to the right, that indicates that the thing on the left is somehow not available for the python version you are constrained to. Note that conda will not change your python version to a different minor version unless you explicitly specify that.

kootenpv commented 3 years ago

Hmmm, that's very weird. So the solution is to install it together with yagmail?

markthomas commented 3 years ago

Same problem in python 3.8. I'm a python newbie, but it appears that premailer is not listed as a module dependency, because it didn't install with yagmail. Also, when I try to install premailer separately, it fails for the same reason. It hasn't been updated to work with 3.7 or 3.8 and I don't know enough to update the specifications to make it work. So it seems that yagmail is useless to me or anyone with 3.7 or newer, as we get a runtime error (at least on Windows). Funny thing is, I'm just sending one line of text. I don't need premailer and would bypass it entirely if I could.

kootenpv commented 3 years ago

Looks like premailer is now listed as possibility for 3.8.

In any case, I think it should be possible to send when you pass prettify_html=False?

codeananda commented 1 year ago

Update: just installed premailer with conda install -c conda-forge premailer for python 3.10 and it works fine.

Still an issue that premailer is not listed as a dependency though

kootenpv commented 1 year ago

@codeananda it is listed as requirement in setup.py though, so that's rather strange...

codeananda commented 1 year ago

Do conda installs work differently somehow?

kootenpv commented 1 year ago

Possibly yagmail on conda is outdated

Perhaps you can specify yagmail as a pip dependency specifically, then it should be fine

codeananda commented 1 year ago

True :) I just wanted to highlight that the experience with conda is not as seamless as it could be

On Tue, 1 Nov 2022 at 10:59, Pascal van Kooten @.***> wrote:

Possibly yagmail on conda is outdated

Perhaps you can specify yagmail as a pip dependency specifically, then it should be fine

— Reply to this email directly, view it on GitHub https://github.com/kootenpv/yagmail/issues/186#issuecomment-1298292836, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMG7O6NLR7J2DSBEXXWXWQTWGDSXBANCNFSM4UHF65ZA . You are receiving this because you were mentioned.Message ID: @.***>