problem background
When executing the command in a container pssh
, the following error occurred ( pssh
it was pip install pssh
installed):
Traceback (most recent call last):
File "/usr/local/bin/pssh", line 26, in <module>
from psshlib.cli import common_parser, common_defaults
File "/usr/local/lib/python3.8/dist-packages/psshlib/cli.py", line 9, in <module>
import version
ModuleNotFoundError: No module named 'version'
solution
The reason for this error is that import version
the original intention of is to import /usr/local/lib/python3.8/dist-packages/psshlib
, version.py
but the third-party library is imported by default during execution version
(because absolute import is used), and this library is not installed.
Open /usr/local/lib/python3.8/dist-packages/psshlib/cli.py
the file and change line 9 to .import version
from . import version
⚠️It is strongly recommended to install the latest version of pssh, the old version of pssh will always have unexpected bugs. Execute from the command line
pip install git+https://github.com/lilydjwg/pssh
to install the latest pssh.