The fact that micropip.py supports only upip-compatible packages, has caused confusion among users, though, as several micropython packages (eg. `micropython-oled`) are not compatible with upip.
Therefore I created a new tool, inspired by micropip.py, which installs upip-compatible packages quite like micropip.py, but delegates pip-compatible packages to "pip install --target temp_dir ...".
I haven't published it as separate project yet, as hoped to get your feedback first. The code (single module) is currently available at https://raw.githubusercontent.com/thonn ... minipip.py. It should be compatible with Python 3.6+ and the basic usage doesn't require anything besides stdlib (uploading via serial requires rshell)
Example usages:
* minipip.py install --target /media/user/circuitpy adafruit-circuitpython-ssd1306
* minipip.py install --port /dev/ttyACM0 --target /lib micropython-logging
Here are the full instructions:
Code: Select all
usage: minipip.py [-h] [-r [REQUIREMENT_FILE [REQUIREMENT_FILE ...]]] [-p [PORT]] -t TARGET_DIR [-i INDEX_URL] [-v] [-q] {install} package_spec [package_spec ...]
Meant for installing both upip and pip compatible distribution packages from PyPI and micropython.org/pi to a local directory, USB volume or directly to MicroPython filesystem over
serial connection (requires rshell).
positional arguments:
{install} Currently the only supported command is 'install'
package_spec Package specification, eg. 'micropython-logging' or 'micropython-logging>=0.6'
optional arguments:
-h, --help show this help message and exit
-r [REQUIREMENT_FILE [REQUIREMENT_FILE ...]], --requirement [REQUIREMENT_FILE [REQUIREMENT_FILE ...]]
Install from the given requirements file.
-p [PORT], --port [PORT]
Serial port of the device
-t TARGET_DIR, --target TARGET_DIR
Target directory (on device, if port is given, otherwise local)
-i INDEX_URL, --index-url INDEX_URL
Custom index URL
-v, --verbose Show more details about the process
-q, --quiet Don't show non-error output