PCP-PYTHON(1)
π PCP-PYTHON π
okay bestie, gather round, we're talking about pcp-python β the lil glow-up helper that runs a python script using a python variant of your choosing β¨ (from the General Commands Manual section of the PCP universe, no big deal)
πΈ NAME πΈ
pcp-python β run a python script using a preferred python variant ππ
β¨ SYNOPSIS β¨
pcp python [SCRIPT [ARG] ...]
like, that's the whole vibe. a script, some args, boom π
π¦ DESCRIPTION π¦
so here's the tea, bestie: pcp-python has been replaced by pmpython(1), which is the preferred one now. but pcp-python is still installed, because it's there to provide backwards compatibility. iconic of it, honestly π«Ά
pcp-python gives you a way to run python scripts using a customisable python binary, instead of hard-embedding any particular version of python into every single script. no more committing to one python forever, we're flexible πββοΈ
and why is that cute? because it lets version-independent python code run anywhere πβ¨ all the python modules shipped with PCP support versions 2.6 and later (in the python2 series), and 3.3 and later (in the python3 release series). range, honey. range π
because python monitoring and collecting scripts in PCP are relatively simple (they don't need new modules, language features, etc), it's been possible to make sure they work for all of the python versions above. so it's super common for PCP python scripts to use a "shebang" line that invokes pcp-python like this:
#!/usr/bin/pcp python
this means your custom setting gets injected instead of a hard-coded python version β but the user can still override the python version, like:
$ PCP_PYTHON_PROG=python3 /usr/bin/pcp python --version
Python 3.3.2
$ PCP_PYTHON_PROG=python2 /usr/bin/pcp python --version
Python 2.7.5
look at her go ππ two pythons, one script, zero drama.
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. slay π
by default, the value of PCP_PYTHON_PROG from /etc/pcp.conf gets used. and the default value of this configuration parameter is set depending on some heuristics about the target build platform π§ those heuristics favour the use of python3 in all recent releases of PCP, for those platforms that support it. python3 main character energy fr fr π
π 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). noted, bestie π
π SEE ALSO π
PCPIntro(1)andpcp(1)
Performance Co-Pilot Β· PCP Β· PCP-PYTHON(1)
and that's the whole page, bestie β brought to you by the Performance Co-Pilot girlies over at PCP, filed under PCP-PYTHON(1) πβ¨ go run some version-independent python, you absolute icon π π
π¦ 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
- opensuse-leap 16.0: pcp-doc 6.2.0-160000.4.1 Β· GPL-2.0+ AND CC-BY-SA-3.0
- ubuntu noble: pcp 6.2.0-1.1build4
- ubuntu questing: pcp 6.3.8-1
- ubuntu resolute: pcp 7.1.1-1
- ubuntu stonking: pcp 7.2.1-2build1
- Copyright (c) 2015,2019 Red Hat
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms