Ryan

解决PSSH在python3中不能运行
PSSH – Parallel SSH utility 支持Python3,但是博主装了Python 3.7.4以...
扫描右侧二维码阅读全文
28
2019/07

解决PSSH在python3中不能运行

PSSH – Parallel SSH utility 支持Python3,但是博主装了Python 3.7.4以后发现pssh不能运行

 ⚡ root@Ryan-Vostro ~ #> pssh
Traceback (most recent call last):  File "/mnt/d/Users/Ryan/.pyenv/versions/3.7.4/bin/pssh", line 26, in <module>
    from psshlib.cli import common_parser, common_defaults  File "/mnt/d/Users/Ryan/.pyenv/versions/3.7.4/lib/python3.7/site-packages/psshlib/cli.py", line 9, in <module>
    import version

修复办法

导致错误的是cli.py文件,需要修改两处来解决这个问题。

改动1

找到

import version

修改为

try:
  from version import VERSION
except:
  print('[WARN] Could not import version package in', __file__)
  VERSION=2.3

改动2

找到

parser = optparse.OptionParser(conflict_handler='resolve',
        version=version.VERSION)

修改为

parser = optparse.OptionParser(conflict_handler='resolve',
        version=VERSION)

然后你就可以使用pssh了。

搬瓦工年付$187机房套餐补货了,电信联通优化,512M内存/500G流量/1G带宽,建站稳定,优惠码:BWH1ZBPVK,【点击购买】!
搬瓦工年付$28CN2高速线路,512M内存/500G流量/1G带宽,电信联通优化,延迟低,速度快,建站稳定,优惠码同上,【点击购买】!
Last modification:July 28th, 2019 at 03:23 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment