0

尝试在 Windows XP PC 上安装 Paramiko。我正在运行 Python 3.3.1。环境变量设置为 C:\Python33\;C

我安装了 PyCrypto,没有任何问题。

我已经尝试过 Paramiko 版本 1.9、1.10 和 master 分支版本。

执行 python setup.py install 时出现这些错误:

C:\temp\paramiko-1.10\paramiko-1.10>python setup.py install
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\paramiko
copying paramiko\agent.py -> build\lib\paramiko
copying paramiko\auth_handler.py -> build\lib\paramiko
copying paramiko\ber.py -> build\lib\paramiko
copying paramiko\buffered_pipe.py -> build\lib\paramiko
copying paramiko\channel.py -> build\lib\paramiko
copying paramiko\client.py -> build\lib\paramiko
copying paramiko\common.py -> build\lib\paramiko
copying paramiko\compress.py -> build\lib\paramiko
copying paramiko\config.py -> build\lib\paramiko
copying paramiko\dsskey.py -> build\lib\paramiko
copying paramiko\file.py -> build\lib\paramiko
copying paramiko\hostkeys.py -> build\lib\paramiko
copying paramiko\kex_gex.py -> build\lib\paramiko
copying paramiko\kex_group1.py -> build\lib\paramiko
copying paramiko\logging22.py -> build\lib\paramiko
copying paramiko\message.py -> build\lib\paramiko
copying paramiko\packet.py -> build\lib\paramiko
copying paramiko\pipe.py -> build\lib\paramiko
copying paramiko\pkey.py -> build\lib\paramiko
copying paramiko\primes.py -> build\lib\paramiko
copying paramiko\proxy.py -> build\lib\paramiko
copying paramiko\resource.py -> build\lib\paramiko
copying paramiko\rsakey.py -> build\lib\paramiko
copying paramiko\server.py -> build\lib\paramiko
copying paramiko\sftp.py -> build\lib\paramiko
copying paramiko\sftp_attr.py -> build\lib\paramiko
copying paramiko\sftp_client.py -> build\lib\paramiko
copying paramiko\sftp_file.py -> build\lib\paramiko
copying paramiko\sftp_handle.py -> build\lib\paramiko
copying paramiko\sftp_server.py -> build\lib\paramiko
copying paramiko\sftp_si.py -> build\lib\paramiko
copying paramiko\ssh_exception.py -> build\lib\paramiko
copying paramiko\transport.py -> build\lib\paramiko
copying paramiko\util.py -> build\lib\paramiko
copying paramiko\win_pageant.py -> build\lib\paramiko
copying paramiko\__init__.py -> build\lib\paramiko
running install_lib
byte-compiling C:\Python33\Lib\site-packages\paramiko\auth_handler.py to auth_handler.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\auth_handler.py", line 311
    except SSHException, e:
                       ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\channel.py to channel.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\channel.py", line 618
    except PipeTimeout, e:
                      ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\client.py to client.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\client.py", line 450
    except SSHException, e:
                       ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\dsskey.py to dsskey.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\dsskey.py", line 187
    except BERException, x:
                       ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\hostkeys.py to hostkeys.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\hostkeys.py", line 82
    except binascii.Error, e:
                         ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\kex_group1.py to kex_group1.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\kex_group1.py", line 35
    P = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFFL


              ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\message.py to message.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\message.py", line 280
    if i > 0xffffffffL:
                     ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\packet.py to packet.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\packet.py", line 97
    self.__sequence_number_out = 0L
                                  ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\pkey.py to pkey.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\pkey.py", line 307
    except base64.binascii.Error, e:
                                ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\proxy.py to proxy.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\proxy.py", line 62
    except IOError, e:
                  ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\server.py to server.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\server.py", line 605
    except Exception, e:
                    ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\sftp_attr.py to sftp_attr.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\sftp_attr.py", line 47
    FLAG_EXTENDED = 0x80000000L
                              ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\sftp_client.py to sftp_client.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\sftp_client.py", line 88
    except EOFError, x:
                   ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\sftp_file.py to sftp_file.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\sftp_file.py", line 467
    except Exception, x:
                    ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\sftp_handle.py to sftp_handle.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\sftp_handle.py", line 103
    except IOError, e:
                  ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\sftp_server.py to sftp_server.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\sftp_server.py", line 95
    except Exception, e:
                    ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\transport.py to transport.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\transport.py", line 295
    except socket.error, e:
                       ^
SyntaxError: invalid syntax

byte-compiling C:\Python33\Lib\site-packages\paramiko\util.py to util.cpython-33.pyc
  File "C:\Python33\Lib\site-packages\paramiko\util.py", line 51
    out = 0L
           ^
SyntaxError: invalid syntax

running install_egg_info
Removing C:\Python33\Lib\site-packages\paramiko-1.10.1-py3.3.egg-info
Writing C:\Python33\Lib\site-packages\paramiko-1.10.1-py3.3.egg-info
4

2 回答 2

1

paramiko尚不支持 Python3。

安装6仍然需要对paramiko代码进行一些重写。

不确定这些是否支持 Py3k 或满足您的需求,但您可以尝试pushyfabric

于 2013-04-27T22:59:32.083 回答
1

我完成了一个完整的端口,通过了 Py2.5、2.6、2.7、3.2 和 3.3 上的所有测试。需要测试。你可以在主 github repo 的 pull request #233 中找到它。

如果有人可以在 Windows 上进行测试,那将非常有帮助。我在 Mac 上。

于 2013-11-04T01:26:13.970 回答