pipupgrade: ValueError: pip executable not found

Thank you for the awesome tool!

What’s the bug all about?

Running pipupgrade raises ValueError: pip executable not found.

What command led to this issue?

Please type the exact command that led to this issue.

$ pipupgrade
# also tried
$ python -m pipupgrade
# and
$ pipupgrade --pip-path /usr/local/opt/python/libexec/bin/pip 
# (the value of `which pip`)

Logs

Traceback (most recent call last):
  File "/usr/local/bin/pipupgrade", line 5, in <module>
    from pipupgrade.__main__ import main
  File "/usr/local/lib/python3.7/site-packages/pipupgrade/__init__.py", line 7, in <module>
    from pipupgrade.__main__    import main
  File "/usr/local/lib/python3.7/site-packages/pipupgrade/__main__.py", line 5, in <module>
    from pipupgrade.commands import command as main
  File "/usr/local/lib/python3.7/site-packages/pipupgrade/commands/__init__.py", line 12, in <module>
    from pipupgrade.commands.helper import (
  File "/usr/local/lib/python3.7/site-packages/pipupgrade/commands/helper.py", line 10, in <module>
    from pipupgrade.model         	import Registry
  File "/usr/local/lib/python3.7/site-packages/pipupgrade/model/__init__.py", line 3, in <module>
    from pipupgrade.model.package  import Package
  File "/usr/local/lib/python3.7/site-packages/pipupgrade/model/package.py", line 12, in <module>
    from pipupgrade 	 		import _pip, semver, request as req, db, log
  File "/usr/local/lib/python3.7/site-packages/pipupgrade/_pip.py", line 54, in <module>
    _PIP_EXECUTABLES = _get_pip_executable(multiple = True)
  File "/usr/local/lib/python3.7/site-packages/pipupgrade/_pip.py", line 49, in _get_pip_executable
    raise ValueError("pip executable not found.")
ValueError: pip executable not found.

I’m on MacOS, with python installed through brew. I don’t have any oddities in my config.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 2
  • Comments: 16 (5 by maintainers)

Most upvoted comments

Same here in MacOS Big Sur, problem is in:

                if exec_ not in execs and not osp.islink(exec_):
                    execs.append(exec_)

Many of us using brew have symlinked pips in our paths, so nothing is added to execs.

What about using this instead:

                exec_ = osp.realpath(exec_)
                if exec_ not in execs:
                    execs.append(exec_)

?