pipx: installation is broken on MacOS ?

Describe the bug

Hi ! I attempted to install pipx following the instructions on Pypi

How to reproduce

brew install pipx
pipx ensurepath

output

Traceback (most recent call last):
  File "/usr/local/Cellar/pipx/0.15.4.0/libexec/bin/pipx", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'

Expected behavior Successful install ? 😃

my specs

macOS version Catalina 10.15.6 Homebrew 2.4.9

I’m happy to provide more specific details about my env if needed !

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (16 by maintainers)

Most upvoted comments

Why is brew install pipx recommended over python3 -m pip install pipx in the first place? I tried the latter on macOS before reading the docs and things seem to be working fine with python 3.7.7

@AlJohri knows more than I do about this, but among the advantages: brew install pipx installs pipx and its dependencies to its own isolated environment, so it doesn’t clutter up your main python installed packages (e.g. when you type pip list).

python3 -m pip install pipx this can work just fine most of the time, fail horribly if the system python is read-only, cause random issues if pipx requires dependencies that are in conflict with other packages you’ve installed. We have not solved yet how to bootstrap pipx itself (something like curl https://get-pipx.zipapp && python3 get-pipx.zipapp to install pipx). Until we do using a operating system installer is your safest option.

Why is brew install pipx recommended over python3 -m pip install pipx in the first place? I tried the latter on macOS before reading the docs and things seem to be working fine with python 3.7.7

Nitpicking, pkg_resources is not part of the standard library, it’s a third-party library (part of setuptools) that gets installed by default when Python is installed (that’s a mouthful).

@AlJohri does the brew formula need updating?