[SOLVED] Execute Error version issue

Please have a look at this error. 4 hours ago it was working, suddenly what happened.

I have also updated the ubidots version, using the following command:-1:

sudo pip install ubidots==1.6.6

Please refer the screenshot and help me.

Please find the below code for random number generation:-1:

import random
import time
from ubidots import ApiClient

api = ApiClient(token=’*******************************’)
variable = api.get_variable(’++++++++++++++++++++++++++’)
while(1):
response = variable.save_value({“value”: random.randint(0, 1000)})
print response
time.sleep(1)

Thanks

Hello @sahsatyajeet,

Referring to the image above I can see that you don’t have installed the python requests library, this is the reason why you are getting that error. Please, reference to the following tutorial which will help you to send data to Ubidots using Python.

All the best,
Maria C.

Please try to understand I am not using HTTP request to send data, Have a look at the program which I have shared above.

But, still if you want me to do, I have already installed requests, using the following the command-

sudo pip install requests

But, the same error exists.

Whether the below mentioned library is not available anymore or deprecated.

from ubidots import ApiClient

I have referred the following example-

requests error

Still facing the same issue-

The code is-

Dear user,

Is important to clarify that the Ubidots Python Library uses HTTP requests to send data. In order of this, if I reference to the code shared by you above you are using HTTP. It is currently possible to send data using our Python Ubidots library, but we are suggesting an alternative way given the great improvements of the request library in the past year. Please, can you see the following guide and let us know how everything goes?

We plan to update the Ubidots library in the next months, meanwhile we strongly advise you to use directly requests.

All the best,
Maria C.

Sorry!! As of now I am not interested in learning HTTP requests. I don’t understand that if the old model doesn’t work, why you still host on your website.

Instead of giving solution to the problem, you are asking me to change the path.

Very bad support

Dear user,

As I mentioned above “It is currently possible to send data using our Python Ubidots library”, we just kindly suggested you an alternative way to solved your problem.

The team just tested the process you’re doind and it works:

  • Installed ubidots library to its latest version
  • Opened a python commnad line
  • Imported ubidots library
  • Get variable
  • Saved value
  • Saw the value in Ubidots

Please see below:

If the above process doesn’t work, then unfortunately it would be related to your Python installation and we can’t be very helpful on that beyond what we’re currently doing.

Best,
Maria C.

Issue is also fixed from my end now.

I just uninstalled everything and reinstalled ubidots with a single command-

sudo pip install ubidots

I am bit worried now, without making any change it started working.

Don’t know how it will perform in future.

Thanks for your overall support till now.

I am glad to read that! Thanks for share it with the community.

All the best,
Maria C.

Thank you Maria.