Blynk library is not recognized in Micropython

I am using Micropython to control ESP8266 V2 with wifi communication to the internet.
My Blynk is at my iPad with iOS, version 12.2. In order to integrate Blynk to my projects, I uploaded the Micropython library making a sudo -H pip3 install Blynk-library-python. Then I created with the example given in, replacing my SSID, password and token with my own.
My problem is the library is not recognized my the board. The error message I get is:

Traceback (most recent call last):
File “”, line 16, in
ImportError: no module named ‘BlynkLib’

Is there something wrong in my procedure? Did I miss something? Please advise.

import BlynkLib
import network
import machine

WIFI_SSID = 'YourWiFiNetwork'       
WIFI_PASS = 'YourWiFiPassword'

BLYNK_AUTH = 'YourAuthToken'

print("Connecting to WiFi...")
wifi = network.WLAN(network.STA_IF)
wifi.connect(WIFI_SSID, WIFI_PASS)
while not wifi.isconnected():

print('IP:', wifi.ifconfig()[0])

print("Connecting to Blynk...")
blynk = BlynkLib.Blynk(BLYNK_AUTH)

def blynk_connected(ping):
    print('Blynk ready. Ping:', ping, 'ms')

def runLoop():
    while True:

# Run blynk in the main thread:

I have never installed Python on an ESP, just on RPI. But what you used and what is shown in the documentation (for ESP install) seems different…

the library and the code I used comes from the same Git repository. I am following the step by step recipe in order to avoid further problems, so it should work but it does not… On a previous stage, also installed and tried to “import” the library you refer to, but with no success either

I am certain the libraries have been installed, but the board does not seem to acknowledge it.

That sounds like you used the install for RPi / Linux


What you need is this… as previously linked above…

I uploaded the library to the device directly, and worked just fine. Thanks a lot

1 Like