pipx: virtualenv's `/bin` is not in `PATH` when executing command

I have noticed the bin directory associated with a venv is not included in $PATH when the command is run.

My initial issue was I get some trouble to run west command:

$ west
... <does not work as expected> ...

(note the error looked absolutely unrelated to $PATH)

I found it did work if I sourced the venv first:

$ source /home/jerome/.local/pipx/venvs/west/bin/activate
$ west
... <work as expected> ...

After some investigations, I found:

$ PATH=$PATH:/home/jerome/.local/pipx/venvs/west/bin west
... <work as expected> ...

I believe the pipx promise is to allow to run west directly exactly as if the venv was activated before.

Note this issue has already been noticed by #1369. However, I don’t expect the same behavior.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28 (15 by maintainers)

Most upvoted comments

FYI, Alyssa Coghlan gave a very useful answer.