Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError 'email' is not a package #13092

Open
1 task
krishnaglodha opened this issue Apr 13, 2023 · 0 comments
Open
1 task

ModuleNotFoundError 'email' is not a package #13092

krishnaglodha opened this issue Apr 13, 2023 · 0 comments

Comments

@krishnaglodha
Copy link

Expectation / Proposal

Send Email as per this example in the docs

email_credentials_block = EmailServerCredentials.load("gmail-sender")        
        email_address = 'krishna.lodha@geobeyond.it'
        subject = email_send_message.with_options(name=f"email {email_address}").submit(
            email_server_credentials=email_credentials_block,
            subject="Example Flow Notification using Gmail",
            msg="This proves email_send_message works!",
            email_to=email_address,
        )

Traceback / Example

  1. Installed prefect-email package
  2. Using UI, setup block for email package for gmail ( Password is App password that I got from my gmail )

Screenshot 2023-04-13 at 10 01 54 AM

3. running `python sync.py` to run flow 4. getting following error
Traceback (most recent call last):
  File "/Users/krishnaglodha/Documents/work/geobeyond/georoma-probe/sync.py", line 2, in <module>
    from prefect import flow, task
  File "/Users/krishnaglodha/Documents/work/geobeyond/georoma-probe/env/lib/python3.9/site-packages/prefect/__init__.py", line 25, in <module>
    from prefect.states import State
  File "/Users/krishnaglodha/Documents/work/geobeyond/georoma-probe/env/lib/python3.9/site-packages/prefect/states.py", line 10, in <module>
    import httpx
  File "/Users/krishnaglodha/Documents/work/geobeyond/georoma-probe/env/lib/python3.9/site-packages/httpx/__init__.py", line 2, in <module>
    from ._api import delete, get, head, options, patch, post, put, request, stream
  File "/Users/krishnaglodha/Documents/work/geobeyond/georoma-probe/env/lib/python3.9/site-packages/httpx/_api.py", line 4, in <module>
    from ._client import Client
  File "/Users/krishnaglodha/Documents/work/geobeyond/georoma-probe/env/lib/python3.9/site-packages/httpx/_client.py", line 9, in <module>
    from ._auth import Auth, BasicAuth, FunctionAuth
  File "/Users/krishnaglodha/Documents/work/geobeyond/georoma-probe/env/lib/python3.9/site-packages/httpx/_auth.py", line 7, in <module>
    from urllib.request import parse_http_list
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 86, in <module>
    import email
  File "/Users/krishnaglodha/Documents/work/geobeyond/georoma-probe/email.py", line 1, in <module>
    from prefect_email import EmailServerCredentials
  File "/Users/krishnaglodha/Documents/work/geobeyond/georoma-probe/env/lib/python3.9/site-packages/prefect_email/__init__.py", line 2, in <module>
    from .credentials import EmailServerCredentials, SMTPServer, SMTPType
  File "/Users/krishnaglodha/Documents/work/geobeyond/georoma-probe/env/lib/python3.9/site-packages/prefect_email/credentials.py", line 5, in <module>
    from smtplib import SMTP, SMTP_SSL
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/smtplib.py", line 47, in <module>
    import email.utils
ModuleNotFoundError: No module named 'email.utils'; 'email' is not a package
@desertaxle desertaxle transferred this issue from PrefectHQ/prefect-email Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant