Search code examples
pythongmailimapimaplib

Trying to login to my gmail; imaplib.error: b'[AUTHENTICATIONFAILED] Invalid credentials (Failure)'


I'm new to Python, and I'm doing this for work, so please explain like im 5 years old

I'm trying to login to my gmail account to automatically download all attachments.

I'm trying to initialize a connection but I get this:

see code and error here

edit:

see my gmail account settings here

Any help would be amazing. Thanks.


Solution

  • I named another project called 'email.py'. This ruined the 'import email' command.

    I will use more apt names for my python projects now.