Search code examples
pythonmodulemicropythonsmbusarduino-esp32

ImportError: no module named 'smbus2'


I'm using Pymakr on VScode to program a Pycom L01, which is connected to several sensors. i'm trying to use smbus2 library, but i can't import it.
I created a python virtual enviroment and installed it using 'pip install smbus2', but when i try to upload the sketch, the output is:

    Traceback (most recent call last):
    File "main.py", line 4, in <module>
    File "/flash/lib/bmp280.py", line 3, in <module>
    ImportError: no module named 'smbus2' 
    Pycom MicroPython 1.18.2.r1 [v1.8.6-849-e0fb68e] on 2018-12-08; LoPy with ESP32
    Type "help()" for more information.

Someone who can help me?


Solution

  • Solved, that was a noob mistake. The project files were outside the virtual enviroment directory. oof.