Search code examples
pipapt

How to install tool `xmltodict`?


Using ubuntu 20.04.5 I am trying to install the tool xmltodict as follows:

$ pip install xmltodict
/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
/usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
Defaulting to user installation because normal site-packages is not writeable
Collecting xmltodict
  Using cached xmltodict-0.13.0-py2.py3-none-any.whl (10.0 kB)
Installing collected packages: xmltodict
Successfully installed xmltodict-0.13.0

But when I try to use this tool as follows

cat run.tcx | xmltodict 2

I get an error

xmltodict: command not found

I already uninstalled and tried to re-install, but same issue. I also have no alias defined with the same name, and which xmltodict returns nothing.

Installing it via

sudo apt install python-xmltodict

also does not seem to install it.

What could be wrong this time?


Solution

  • The package doesn't install any scripts or entry points. It only installs an importable module xmltodict.py. The module seems to be runnable but not directly executable so try python -m xmltodict:

    cat run.tcx | python -m xmltodict 2