114532 Views
101685 Views
86270 Views
54891 Views
51137 Views
49962 Views
Level Up your CAD Skills
Operation Pico
Raspberry Pi Home Hub
Hacky Temperature and Humidity Sensor
Robot Makers Almanac
High Five Bot
Using the Raspberry Pi Pico's Built-in Temperature Sensor
Getting Started with SQL
Introduction to the Linux Command Line on Raspberry Pi OS
How to install MicroPython
Wall Drawing Robot Tutorial
BrachioGraph Tutorial
KevsRobots Learning Platform
66% Percent Complete
By Kevin McAleer, 3 Minutes
In MicroPython, the Python Package Index PyPi (https://www.pypi.org) is an opensource repository of software packages that you can install to extend the functionality of your projects. PyPi contains libraries, modules, and tools that you can use in your MicroPython programs. You can also create a free account on PyPi and submit your own packages to share with the community.
PyPi
The Python Package Index (PyPi) is a repository of software packages for the Python programming language. It contains libraries, modules, and tools that you can install and use in your Python projects. PyPi is a valuable resource for developers, as it provides access to a wide range of packages that can help you build and enhance your projects.
While PyPi is primarily designed for standard Python, many packages are also compatible with MicroPython. However, due to the limited resources of microcontrollers, not all PyPi packages will work with MicroPython.
To install a package from PyPi, you would typically use the pip tool in standard Python. However, for MicroPython, you will often use a similar tool called mip.
pip
mip
MicroPython includes the mip module, which can install packages from the micropython-lib repository and third-party sites like GitHub and GitLab. The mip tool is similar to Python’s pip but is tailored for MicroPython’s ecosystem. It does not use the PyPI index; instead, it defaults to micropython-lib.
micropython-lib
MIP (MicroPython Install Packages) is a package manager for MicroPython. It allows you to install and manage packages specifically designed for MicroPython. This includes libraries that are optimized for the constraints of microcontrollers.
MIP
You can use mip from the REPL to install packages. Here are some examples:
import mip # Install the latest version of "pkgname" (and dependencies) mip.install("pkgname") # Install a specific version of "pkgname" mip.install("pkgname", version="x.y") # Install the source version (i.e., .py rather than .mpy files) mip.install("pkgname", mpy=False)
.mpy
PyPi and MIP are essential tools for enhancing your MicroPython projects. PyPi provides a vast repository of packages for standard Python, many of which are compatible with MicroPython. MIP, on the other hand, is specifically designed for MicroPython, allowing you to install and manage packages optimized for microcontrollers. By leveraging these tools, you can significantly extend the functionality and capabilities of your MicroPython projects.
< Previous Next >