Upgrading Python Homebrew packages using pip

VisiData 2.0 came out today. I previously installed VisiData using Homebrew, but the VisiData tap has not yet been updated with the latest version.

Homebrew Python packages (including the packages for Datasette and sqlite-utils) work by setting up their own package-specific virtual environments. This means you can upgrade them without waiting for the tap.

To find the virtual environment, run head -n 1 against the Homebrew-providid executable. VisiData is vd, so this works:

% head -n 1 $(which vd)
#!/usr/local/Cellar/visidata/1.5.2/libexec/bin/python3.8

Now you can call pip within that virtual directory to perform the upgrade like so:

/usr/local/Cellar/visidata/1.5.2/libexec/bin/pip install -U visidata

Created 2020-10-14T09:21:01-07:00 · Edit