Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7995

MicroPython • Re: How to import a library for raspberry pi pico w

$
0
0
You can put libraries to be imported in the directory the main application is in or the "/lib" directory,.

If your application is in the "/" root directory and run from there you can put its libraries in the same "/" root directory.

You can put libraries in other directories but you will have to tell MicroPython to look in those directories when searching for libraries.

You can spread your libraries all over the place if you want though it's not recommended.

The main risk is that you end up with multiple same name libraries from different sources or differing version and the order libraries are searched for may cause the wrong library or version to be chosen and used when imported.

Common practices are (1) application and libraries in "/" root directory, or (2) application in "/" root directory with libraries in "/lib".

Statistics: Posted by hippy — Thu Feb 12, 2026 12:46 am



Viewing all articles
Browse latest Browse all 7995

Trending Articles