A New Collection of Thoughtful Learning Apps — Now Available on iOS & Android

Image
I’m excited to share a set of mobile apps I’ve recently completed and published on both the Google Play Store and the Apple App Store. These apps are designed with a simple goal in mind: to make meaningful, structured content more accessible, whether you’re studying theology or improving your English vocabulary. 📱 Now Available on Both Platforms All apps are live and available for download: Google Play Developer Page: https://play.google.com/store/apps/dev?id=5835943159853189043 Apple App Store Developer Page: https://apps.apple.com/ca/developer/q-z-l-corp/id1888794100 📖 Theology & Confession Study Apps For those interested in Reformed theology and classical Christian teachings, I’ve developed a series of apps that present foundational texts in a clean, focused reading format: The Belgic Confession Canons of Dort Heidelberg Catechism Westminster Shorter Catechism Each app is designed to provide a distraction-free experience, making it easier to read, reflect, and revisit these im...

How to fix error : no module named sendgrid when try to use sendgrid python lib in PHP.


"no module named sendgrid" error reported with below codes:

<?php
system("/usr/bin/python sendmail.py 2>&1");
system("/usr/bin/python --version 2>&1", $ret);
?>

sendmail.py

import sendgrid
import os
from sendgrid.helpers.mail import *

sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
from_email = Email("test@example.com")
to_email = Email("test@example.com")
subject = "Sending with SendGrid is Fun"
content = Content("text/plain", "and easy to do anywhere, even with Python")
mail = Mail(from_email, subject, to_email, content)
response = sg.client.mail.send.post(request_body=mail.get())
print(response.status_code)
print(response.body)
print(response.headers)
....






It is very strange, since I have installed sendgrid.
pip list | grep sendgrid
sendgrid (4.1.0)
$pip list | grep sendgrid
sendgrid (4.1.0)

but when I use check the pip list in php runtime,
<?php
system("pip list | grep sendgrid 2>&1", $ret);
system("/usr/bin/python --version 2>&1", $ret);
?>
sendgrid not found indeed.

It seems like sendgrid was just installed to my env.
in the php runtime env, it was not installed.

Fix solution:
Install sendgrid from source code.

git clone https://github.com/sendgrid/sendgrid-python.git
cd sendgrid-python
python setup.py build
sudo python setup.py install

pip install python_http_client
git clone https://github.com/sendgrid/python-http-client.git
cd python-http-client/
python setup.py build 
sudo python setup.py install

OK. I got 202 status finally, which means email was sent successfully.

❤️ Support This Blog


If this post helped you, you can support my writing with a small donation. Thank you for reading.


Comments

  1. Amazing post.
    Thank you for being a thought leader in the tech industry.
    Seeking the top mobile app development company in India, contact us - renowned for our expertise, we excel in crafting innovative and high-quality mobile applications. Our team of skilled professionals is dedicated to delivering cutting-edge solutions tailored to your needs. Get started today!

    ReplyDelete

Post a Comment

Popular Posts

Fix “A problem occurred starting process 'command node'” in Android Studio for React Native

Swagger annotations for API that allows downloading files as zip

2023, New Start! New AdSense Account! New Earnings!