Brew can't find python dependency [closed]

17 hours ago 3
ARTICLE AD BOX

Trying to install qemu on mac, which requires a python dependency "tomli". I've not been able to install it such that it's accessible to brew.

If installing via pip3, there's an error saying that this is an externally managed environment.

If I configure the external environment and install tomli there, it's not recognized by brew.

Generally, I seem not able to make brew use a different python installation. It always shows:

python determined to be '/usr/bin/python3'

I've tried editing the formula brew edit qemu, adding the environment's python first to PATH, installing tomli on brew's own python installation, but it just keeps using /usr/bin/python3 and the dependency is not there.

How to solve this? all I want is just brew install qemu to work.

Edit: more structured breakdown, as requested:

brew install qemu (I've addressed brew install qemu --ignore-dependencies so far, as with dependencies it doesn't work for different reasons, but provided for completeness):

...

==> make install Last 15 lines from ~/Library/Logs/Homebrew/vde/03.make.log: 395 |
vdehist_termwrite(fd,opt,3); | ~~~~~~~~~~~~~~~~~ ^~~~~~~~ libvdehist.c:440:21: error: too many arguments to function call, expected 0, have 3 440 |
n=vdehist_termread(st->termfd,buf,BUFSIZE); | ~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~ libvdehist.c:475:28: error: too many arguments to function call, expected 0, have 3 475 |
vdehist_termwrite(st->termfd,"\033[C",3); | ~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~ fatal error: too many errors emitted, stopping now [-ferror-limit=]

(I also tried to disable the vde dependency that's apparently causing this from the formula: brew edit qemu, #depends_on "vde", but this didn't fix it, so I decided to try with --ignore-dependencies).

brew install qemu --ignore-dependencies

...

Using './build' as the directory for build output python determined to be '/usr/bin/python3' python version: Python 3.9.6 mkvenv: Creating non-isolated virtual environment at 'pyvenv'

*** Ouch! ***

found no usable tomli, please install it

Read Entire Article