The python packages with a command all have a corresponding entry-point script that runs a specific function. For instance, the amon command executes its entry-point script, which itself executes the package's main function.
Therefore, the location of this script is necessary if we want to add it to PATH, or run it directly.
Note: For virtual environments, the script should be added to
PATHautomatically. If not, please consult the virtual environment's documentation.
- Entry-point scripts go to:
- macOS/Linux:
/usr/local/bin/ - Windows:
C:\Python3x\Scripts\
- macOS/Linux:
- Check with:
python -c "import sysconfig; print(sysconfig.get_path('scripts'))"- Entry-point scripts go to:
- macOS:
~/Library/Python/3.x/bin/ - Linux:
~/.local/bin/ - Windows:
%APPDATA%\Python\Python3x\Scripts\
- macOS:
- Check with:
python -m site --user-baseThe script's directory's path is what needs to be added to PATH.
If using bash:
echo 'export PATH="path/to/amon/directory:$PATH"' >> ~/.bashrc
source ~/.bashrc If using zsh:
echo 'export PATH="path/to/amon/directory:$PATH"' >> ~/.zshrc
source ~/.zshrc Note: To change the current shell session's
PATHonly:export PATH="path/to/amon/directory:$PATH"
Consult https://www.eukhost.com/kb/how-to-add-to-the-path-on-windows-10-and-windows-11/