[SOLVED] Python with Edison Board: ImportError cannot import nameApiClient


#1

i tried with this code:

import time, mraa
from ubidots import ApiClient

for i in range(0,5):
 try:
  print "Conectando con ubidots"
  api = ApiClient(token='A1E-jjgga5GJtUKlsJJIrnvB1B6uyfZRtQ')
  break
 except:
  print "No se puede, reintentando..."
  time.sleep(5)

a0 = mraa.Aio(0)

while 1:
 try: 
  api.save_collection([{'variable':
'599dc807c03f9719da0a286c','value':a0.read()}])

 except:
  print "No se puede enviar los datos"

but i have import error cannot import name ApiClient when i run it. But i tried with the issue of the version of pip but i can’t solved it, and yes, i have installed ubidots, and when i try to install and desinstall y received this screen.

Thanks


#2

Hello,

Following the response, your issue is during the import process. Please, reference to this article to start with the Intel Edison and Ubidots using python.

NOTE: Before install the Ubidots library, verify if the version of the library is assigned as the command shows -> pip install ubidots==1.6.6, don’t forget to use sudo if necessary.

Let me know how everything goes! :wink:

All the best,
Maria C.


#3

Thanks, i’ve tried but i have the same error, also i’ve runned the code in other device and works


#4

Hello @chevaliersawada,

Looping into your answer, we can discard that is an hardware issue. Regrettably, that kind of issue is out of our scope.

One other thing that you can try is make the HTTP request to Ubidots using the request library for python, this article will help you with everything! :grinning:

All the best,
Maria C.