No module '_thread' or Paho

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
thylekk
Posts: 6
Joined: Sun Dec 15, 2019 12:10 pm

No module '_thread' or Paho

Post by thylekk » Wed Dec 25, 2019 2:44 am

Hello,

I am working on my school project where I make webserver (MicroWebSrv2) and connection to broker via MQTT on Pyboard. The problem is that for webserver I need "_thred" library and for broker connection I need "paho", however whenever I try to import them, the console says
'no module named _thread' or 'no module named paho'.

Question is how do I get these libraries to the pyboard since I do not have them here. I searched the internet and I can not find any way to download them or install them directly.

Thanks:)
Attachments
sasasaassasa.PNG
sasasaassasa.PNG (14.94 KiB) Viewed 197 times

User avatar
pythoncoder
Posts: 4037
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: No module '_xxxx'

Post by pythoncoder » Wed Dec 25, 2019 8:17 am

Paho is a large Python library which does not exist on MicroPython. You will find MicroPython MQTT implementations in the MicroPython library which can be installed using upip.

Your problem with threading is that standard Pyboard D firmware does not have threading enabled. One solution is to create a build which has it. The other is to use a web server such as PicoWeb which doesn't use it.
Peter Hinch

thylekk
Posts: 6
Joined: Sun Dec 15, 2019 12:10 pm

Re: No module '_thread' or Paho

Post by thylekk » Wed Dec 25, 2019 12:12 pm

thank you

Post Reply