Is there any way globally run pex? I am trying to ...
# general
c
Is there any way globally run pex? I am trying to create pex binary and want to add bin folder to execute anywhere in my mac. What is the option that I can do?
e
If I understand correctly this is not a PEX question at all. For any binary at all, it needs to be in one of the directories in your
PATH
in order to be globally executable. Common means of doing this for normal users is to add either
~/bin
or
~/.local/bin
to your
PATH
and then copy or symlink binaries in that directory.
c
I was just curious that how people execute pex globally or there is any way standard way do to do. thanks @enough-analyst-54434
e
Pex the tool or PEX files created by Pex the tool?
c
What I want to do is to create sort of cli created by pex and I want to distribute locally. something like homebrew..
e
Ok. So how do you do this for any other Python tool?
I personally just:
Copy code
python -mvenv ~/bin/pex.venv
~/bin/pex.venv/bin/pip install -U pex
cd ~/bin
ln -s pex.venv/bin/pex
Then I run
~/bin/pex.venv/bin/pip install -U pex
when I want to update to a newer version.
Here, `~/bin`is on my
PATH
.
Some people like
pipx
for installing Python tools. I have never used it.
You can also download a Pex PEX from releases: https://github.com/pantsbuild/pex/releases Just mark it executable and place on your
PATH
.
c
let me try!