Install PCP:
$ echo "deb https://dl.bintray.com/pcp/xenial xenial main" | sudo tee
-a /etc/apt/sources.list
$ sudo apt-get update
$ sudo apt-get install pcp pcp-gui pcp-doc python-pcp
I think Xenial defaults to Python 3, so we get:
$ pmrep network.interface.in.bytes
Traceback (most recent call last):
File "/usr/bin/pmrep", line 65, in <module>
from pcp import pmapi, pmi
ImportError: No module named 'pcp'
Install the Python 3 bindings and try again:
$ sudo apt-get install python3-pcp
$ pmrep network.interface.in.bytes
Traceback (most recent call last):
File "/usr/bin/pmrep", line 65, in <module>
from pcp import pmapi, pmi
File "/usr/lib/python3/dist-packages/pcp/pmi.py", line 66, in <module>
LIBPCP_IMPORT.pmiDump.restype = None
File "/usr/lib/python3.5/ctypes/__init__.py", line 360, in __getattr__
func = self.__getitem__(name)
File "/usr/lib/python3.5/ctypes/__init__.py", line 365, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: python3: undefined symbol: pmiDump
pmiostat still works when in this state.
Install some random things which sound about right :)
$ sudo apt-get install libpcp-import1
Now the original command works fine:
$ pmrep network.interface.in.bytes
Removing python3-pcp breaks it with "ImportError: No module named 'pcp'" again.
I'm not sure how to fix this. Reading "Declaring relationships between
packages" [1] I see debian/control.master contains:
Package: pcp
Depends: ..., python-pcp | python3-pcp, python | python3
Is this a preferential order? Like it prefers "python,python-pcp" over
"python3,python3-pcp"? Would reversing this order make it so that
"python3" is preferred over "python" and would install "python3-pcp"
where "python3" is installed?
Debian Jessie and Ubuntu Xenial are making Python 3 the default so
will have "python3" installed. Older releases without "python3" should
fall back to "python-pcp" I guess.
This Depends line seems to need "libpcp-import1" added to it as well.
Any guidance appreciated?
Jamie
[1] https://www.debian.org/doc/debian-policy/ch-relationships.html
|