Home > Enterprise >  Install black with pipx not install dependencies aiohttp
Install black with pipx not install dependencies aiohttp

Time:01-15

On MacOs I've installed with brew the pipx:

brew install pipx

then pipx install black

$ pipx list                                           
venvs are in /Users/mc/.local/pipx/venvs
apps are exposed on your $PATH at /Users/mc/.local/bin
   package black 22.12.0, installed using Python 3.11.1
    - black
    - blackd

However, I keep getting missing dependency:

$ /Users/mc/.local/bin/blackd                         
Traceback (most recent call last):
  File "/Users/mc/.local/bin/blackd", line 5, in <module>
    from blackd import patched_main
  File "/Users/mc/.local/pipx/venvs/black/lib/python3.11/site-packages/blackd/__init__.py", line 14, in <module>
    raise ImportError(
ImportError: aiohttp dependency is not installed: No module named 'aiohttp'. Please re-install black with the '[d]' extra install to obtain aiohttp_cors: `pip install black[d]`
  1. How to fix it?

  2. Why pipx is not solving this dependency while installing black ?

  3. Why it uses some (no idea where is this installed) python 3.11.1 when my system python is 3.9.6

    $ python3 --version
    Python 3.9.6

EDIT

I've did as advised by below answer from @KarlKnechtel :

$ brew install [email protected]                                
==> Auto-updated Homebrew!
Updated 1 tap (romkatv/powerlevel10k).

You have 2 outdated formulae installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

==> Fetching [email protected]
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.10/manifests/3.10.9
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.10/blobs/sha256:a9b28161cec6e1a027f1eab7576af7
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:a9b28161cec6e1a027f
######################################################################## 100.0%
==> Pouring [email protected]_monterey.bottle.tar.gz
==> /opt/homebrew/Cellar/[email protected]/3.10.9/bin/python3.10 -m ensurepip
==> /opt/homebrew/Cellar/[email protected]/3.10.9/bin/python3.10 -m pip install -v --no-deps --no-index --upgr
==> Caveats
Python has been installed as
  /opt/homebrew/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /opt/homebrew/opt/[email protected]/libexec/bin

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /opt/homebrew/lib/python3.10/site-packages

tkinter is no longer included with this formula, but it is available separately:
  brew install [email protected]

See: https://docs.brew.sh/Homebrew-and-Python
==> Summary
           
  • Related