Can't install adafruit-micropython-blinka

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
phero
Posts: 1
Joined: Fri Dec 17, 2021 10:22 am

Can't install adafruit-micropython-blinka

Post by phero » Fri Dec 17, 2021 10:42 am

Hello!

I'm new to MicroPython and Python in general so please forgive me if this is a stupid question.

I'm trying to use a Raspberry Pi Pico with an MCP23017. So in order to install the MCP library i do this:

Code: Select all

python3 -m pip install adafruit-circuitpython-mcp230xx
Which works well.

When I try to run the program to connect to the MCP23017 I get a
Module not found: digitalio

As far as I can see I need to install adafruit-micropython-blinka to fix that problem

But when I try to do that I get an error:

Code: Select all

python3 -m pip install adafruit-micropython-blinka
Password:
WARNING: The directory '/Users/persommer/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Collecting adafruit-micropython-blinka
  Downloading Adafruit-Micropython-Blinka-1.0.0.tar.gz (11 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python@3.10/bin/python3.10 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-3air0m4f/adafruit-micropython-blinka_07c2d03c265b433fa85018754a5b01b9/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-3air0m4f/adafruit-micropython-blinka_07c2d03c265b433fa85018754a5b01b9/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-z5z44ov_
       cwd: /private/tmp/pip-install-3air0m4f/adafruit-micropython-blinka_07c2d03c265b433fa85018754a5b01b9/
  Complete output (5 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/tmp/pip-install-3air0m4f/adafruit-micropython-blinka_07c2d03c265b433fa85018754a5b01b9/setup.py", line 39, in <module>
      with open(os.path.join(here, 'src', '__version__.py')) as f:
  FileNotFoundError: [Errno 2] No such file or directory: '/private/tmp/pip-install-3air0m4f/adafruit-micropython-blinka_07c2d03c265b433fa85018754a5b01b9/src/__version__.py'
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/31/e4/9ceebeb7a811cce5a1c9cb47a31e51c82a25e2a7f8d97656f7ef27703f2e/Adafruit-Micropython-Blinka-1.0.0.tar.gz#sha256=fb0af4bbcd50c92966c13d29455b5c0ca1d7aca011885c6971723df9e7cedc26 (from https://pypi.org/simple/adafruit-micropython-blinka/) (requires-python:>=3.6.0). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement adafruit-micropython-blinka (from versions: 1.0.0)
ERROR: No matching distribution found for adafruit-micropython-blinka
I also tried to install it in apps like PyCharm and Thonny and they all give the same error.

I'm on MacOS on an M1 MacMini

I hope someone can help me out!

Thank you!

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: Can't install adafruit-micropython-blinka

Post by scruss » Fri Dec 17, 2021 7:52 pm

Those pip commands look like you're installing the modules onto your Mac. And while blinka was originally developed for Adafruit by one of the former regulars around here (user cefn), it's gone very much its own way since then. Support for it is generally managed by Adafruit, who will likely suggest you use their CircuitPython system instead of MicroPython.

There is, however, the mcauser/micropython-mcp23017: MicroPython driver for MCP23017 16-bit I/O Expander module (found via the Awesome MicroPython catalogue, which needs to be better known). It won't work exactly like the blinka module, but it will allow you to use the I/O module fairly easily

easylab4kids
Posts: 20
Joined: Mon Aug 12, 2019 10:58 am
Location: Ellisras, Suid-Afrika ("South Africa")

Re: Can't install adafruit-micropython-blinka

Post by easylab4kids » Thu Jan 06, 2022 3:49 pm

It may help if you create a Python virtual environment.
That way less chance of insufficient privileges.

You could try my script https://github.com/pappavis/thescript/b ... tualenv.sh which should work fine on MacOS too.
met vriendelijke groet,
Easylab4kids.nl

Post Reply