kootenpv / yagmail

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

no module named error #13

Closed martinberoiz closed 5 years ago

martinberoiz commented 9 years ago

Hello,

Right after installing yagmail with pip install I get this error as soon as I import the module:

import yagmail Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/site-packages/yagmail/init.py", line 6, in from .yagmail import SMTP File "/usr/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 16, in from .validate import validate_email_with_regex File "/usr/local/lib/python2.7/site-packages/yagmail/validate.py", line 31, in from yagmail.error import YagInvalidEmailAddress ImportError: No module named error

What could this be?

kootenpv commented 9 years ago

Could you try rerunning it with pip install -U yagmail? I thought this should be solved by now by using from __future__ import absolute_import at the top of the script in the latest update. It also seems like it passes the tests on python 2.7 (see Travis CI).

martinberoiz commented 9 years ago

Oh, ok. It must be just me then. I tried with -U option but didn't work either. Thanks.

kootenpv commented 9 years ago

Actually, thanks for raising an issue! It apparently wasn't working for Python 2.7

I guess somehow the test didn't catch it.

See also the following issue:

https://github.com/kootenpv/yagmail/commit/4a434976fd23d98ca69772d632ccaa5c535d7bf8

It has been rolled back, so now you can for sure install it (but it certainly bothers me that it doesn't look nice).

Let me know if it works, then I'll close it.

wingnut2626 commented 8 years ago

Hello, I have installed yagmail via

sudo pip3 install yagmail

on my system. I am getting an ImportError with no module of that name. Any ideas?

IF ANYONE ELSE HAS THIS PROBLEM THIS INSTALLS TO PYTHON 3.5 ON UBUNTU

kootenpv commented 8 years ago

@wingnut2626 Try to update to a newer version perhaps: sudo pip3 install -U yagmail

guigashm commented 8 years ago

Hello,

I had a similar issue, solved by using sudo.

I used: sudo pip install yagmail

In the yagmail GIT page, probably the instructions should have:

sudo pip install yagmail sudo pip3 install yagmail

kootenpv commented 8 years ago

@guigashm Strange, I'm able to install without sudo on a new system. I'm out of ideas. But I took your advice into the README at the errors section. Thanks for posting.

Lvl4Sword commented 6 years ago

I would suggest not using sudo to pip install anything. Do you have another file called error.py?

Doing the following works on Debian 9:

kootenpv commented 5 years ago

I think this is not an issue anymore? Feel free to reopen.

jerzybrzoska commented 3 years ago

Yeah, it started to happen again:

ModuleNotFoundError: No module named 'yagmail'

Didn't happen last year. though. I installed it via pip3 install yagmail. pip3 install -U yagmail does not help at all.

kootenpv commented 3 years ago

Yeah, it started to happen again:

ModuleNotFoundError: No module named 'yagmail'

Didn't happen last year. though. I installed it via pip3 install yagmail. pip3 install -U yagmail does not help at all.

Did you try python3 afterwards, i.e. the same version as pip3