Import Error: cannot import name 'Email' from boltiot while running the python code


In my capstone project iam not getting email. So I decided to do the mail gun project once again to check whether am getting the output or not because I installed new vmware, but unfortunately I am getting lot of error… I had install the library files already.

Hi @mohamedabdulkadher.1,

In python, you can not name a file same as the inbuilt function/packages name. For example. email is an inbuilt package of python and I think you have created a file with name email.py also in your current directory.

To show the list of file in your current directory. Type listing command as below.

ls

Then remove the email.py file from your directory.

sudo rm email.py

Now run your program again.

Do let me know in case you need any other information.

1 Like

Hi @mohamedabdulkadher.1,

To debug this issue .

  1. Print the response value before doing the json.loads.
    For example :
response = mybolt.analogRead("A0")
print (response)
data = json.loads(response)
  1. Check if you have internet connection available inside the Vmware by typing the below command in terminal. (Do not insert the below command in the python code, type it in terminal.) and send me the screenshot of output.
ping boltiot.com -c 4

Hi @mohamedabdulkadher.1,

You are getting the internet inside the VMware. Can you check point number 1?

  1. Print the response value before doing the json.loads.
    For example :
response = mybolt.analogRead("A0")
print (response)
data = json.loads(response)

this was the thing I am getting as a output.
And I need to know where can I get my sender email I’d in mailgun.

Hi @mohamedabdulkadher.1,

You are able to send the request to Bolt Cloud and you are also getting the data.

Regarding the email-
Find the sandbox url from Mailgun. It starts with sandbox

Syntax:

SENDER_EMAIL = "This would be test@your SANDBOX_URL"

Example :

SENDER_EMAIL = "test@sandbox6614cebb434e8of2f33b4db91ce.mailgun.org"

After changing the sender email, I am getting like this

.
How can we cancel the continuous reading, for each time iam restarting the vmware to get back the home page.

Hi @mohamedabdulkadher.1,

Your Bolt firmware version in not updated. Please update the Bolt firmware version. Check this link https://docs.boltiot.com/docs/firmware-update

To stop the python program enter control + c buttons

Do let me know in case you need further assitance.