只能从一个目录运行我的copy_files.py

时间:2019-06-03 16:40:41

标签: python paramiko

我只能从一个目录运行copy_files.py脚本。 当我从其他目录运行它时,出现以下错误:

Traceback (most recent call last):
  File "./copy_py", line 36, in <module>
    import paramiko
  File "/usr/local/lib/python3.6/site-packages/paramiko/__init__.py", line 22, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/usr/local/lib/python3.6/site-packages/paramiko/transport.py", line 56, in <module>
    from paramiko.dsskey import DSSKey
  File "/usr/local/lib/python3.6/site-packages/paramiko/dsskey.py", line 27, in <module>
    from cryptography.hazmat.primitives.asymmetric.utils import (
  File "/usr/local/lib/python3.6/site-packages/cryptography/hazmat/primitives/asymmetric/utils.py", line 9, in <module>
    from asn1crypto.algos import DSASignature
  File "/usr/local/lib/python3.6/site-packages/asn1crypto/algos.py", line 26, in <module>
    from .core import (
  File "/usr/local/lib/python3.6/site-packages/asn1crypto/core.py", line 53, in <module>
    import copy
  File "/home/xjacrawf/work/pyth/copy.py", line 106, in <module>
    cli = paramiko.client.SSHClient()
AttributeError: module 'paramiko' has no attribute 'client'

我试图删除脚本的所有正文,甚至重命名了脚本。

#!/usr/local/bin/python3.6

import sys
sys.path.insert(0, "/usr/local/lib/python3.6/site-packages")
import cx_Oracle
import glob
import os
import time
import paramiko
from scp import SCPClient

cli = paramiko.client.SSHClient()
cli.set_missing_host_key_policy(paramiko.client.AutoAddPolicy())

我希望脚本建立连接,并且只是错误。 我从$ MDS_SRC /运行的第一个目录运行脚本,并且运行良好。 我可以将整个脚本复制到我的本地目录中,并且会出错。

0 个答案:

没有答案