sabuhish / fastapi-mail

Fastapi mail system sending mails(individual, bulk) attachments(individual, bulk)
https://sabuhish.github.io/fastapi-mail/
MIT License
698 stars 81 forks source link

No module named 'xxx' issue #142

Closed schuberty closed 2 years ago

schuberty commented 2 years ago

After I installed fastapi-mail 1.1.4 and set it up in my app, I started getting the following "no module found" messages when I import things related to the package, e.g.:

➜ pipenv run py
Loading .env environment variables...
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from fastapi_mail import ConnectionConfig
No module named 'aioredis'
No module named 'httpx'

I can delete my whole environment, reinstall it and it keeps coming back.

zduvall commented 2 years ago

I am getting this as well. It looks like it's coming from these two print statements in fastapi_mail/email_utils/email_check.py.

try:
    import aioredis

    redis_lib = True
except ImportError as error:
    redis_lib = False
    print(error)

try:
    import httpx

    request_lib = True
except ImportError as error:
    request_lib = False
    print(error)

Can we remove the print statements? It looks like the code is setup to optionally function without those packages by design.

Any thoughts @sabuhish? It looks like you may have worked on that part last. Thanks!!

Feijo commented 2 years ago

Any news about it?

sabuhish commented 2 years ago

Changes have already been merged and released, thanks for your help guys! I will close this issue now. Please use version 1.1.5. Thanks!