PMPYTHON(1)
π PMPYTHON(1) β the pmpython manual, but make it make sense π
okay bestie, welcome to the General Commands Manual glow-up of pmpython. sit down, grab a boba, we're doing this π§β¨
β¨ NAME β¨
pmpython β run a python script using a preferred python variant ππ
π SYNOPSIS π
pmpython [python-args-and-script]
πΈ DESCRIPTION πΈ
so the whole point of pmpython, bestie, is that it gives you a way to run python scripts with a customisable python interpreter instead of hard-coding the name of one specific python version into every single script. no cap. it's giving "portable" and we are obsessed π
this is genuinely useful because it means version-independent python code can just run anywhere. all the python modules that ship with PCP support versions 2.6 and later (in the python2 series) and 3.3 and later (in the python3 release series). periodt.
and like, because python monitoring and collecting scripts in PCP are pretty simple (they don't need new modules, new language features, none of that), it's been totally possible to make sure they work across all of the versions above. easy. iconic. π«Ά
BUT β and here's the plot twist β the name of the python interpreter is not always the same everywhere π. so it's super common for PCP python scripts to use a "shebang" line that launches the python interpreter indirectly, like this:
#!/usr/bin/env pmpython
env(1) is the one that finds the correct path for the pmpython executable from the user's $PATH. she's the finder, she's the girl π
by default, the name of the python interpreter is found from the value of $PCP_PYTHON_PROG from the environment (if it's set), else from /etc/pcp.conf. the second one is the more typical case, where this value is based on some heuristics about the platform at the time the PCP packages were built β and it favours the use of python3 in all recent releases of PCP (for those platforms that support it). slay β¨
so basically: this lets an appropriate name be used for the python interpreter instead of a hard-coded python version name, while still letting the user override the python interpreter, like so:
$ PCP_PYTHON_PROG=python3 pmpython --version
Python 3.4.2
$ PCP_PYTHON_PROG=python2 pmpython --version
Python 2.7.9
see how easy that was?? π this is convenient for shipping identical scripts on multiple platforms, and for testing different python versions with the one script β for example, when multiple versions of python are installed, PCP_PYTHON_PROG can be set in the local environment to override the global setting. main character energy fr fr π
oh and one more thing bestie: pmpython is a replacement for an earlier tool with similar function, namely pcp-python(1). we don't gatekeep, but we do upgrade π
π PCP ENVIRONMENT π
environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. on each installation, the file /etc/pcp.conf contains the local values for these variables. and the $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5). iykyk π
π¦ SEE ALSO π¦
env(1), pcp(1), pcp-python(1) and PCPIntro(1). go read them, bestie, they're all right there π
and that's the whole page π no cap, you now know pmpython better than most people know their own wifi password.
this little love letter to portability came to you from Performance Co-Pilot (that's the PCP girlies π), and it's the PMPYTHON(1) page in all her glory. mwah, bye bestie π«Άπ
β¨
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- centos-stream 9: pcp-doc 6.3.7-14.el9 Β· GPL-2.0-or-later AND CC-BY-3.0
- debian trixie: pcp 6.3.8-1
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu questing: pcp 6.3.8-1
- ubuntu resolute: pcp 7.1.1-1
- ubuntu stonking: pcp 7.2.1-2build1
- Copyright (c) 2016 Ken McDonell. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms