三、Windows7 32上安装paramiko模块
1.下载安装python2.7
用下载工具下载这2个文件
http://www.python.org/ftp/python/2.7.5/python-2.7.5.msi
http://peak.telecommunity.com/dist/ez_setup.py
默认安装即可,默认安装路径 C:\Python27,就不演示安装过程了。
安装之后把C:\Python27添加到系统的Path变量里面,然后在命令行下输入python测试一下。
1
2
3
4
|
C:\Users\TestAA>python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC
v
.1500 32 bit (Intel)] on win32
Type
"help"
,
"copyright"
,
"credits"
or
"license"
for
more
information.
>>>
|
看到以上结果,代表python已经安装成功。
2.安装easy_install工具
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
C:\Users\TestAA\Desktop>python ez_setup.py
Downloading http:
//pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-p
y2.
7
.egg
Processing setuptools-
0
.6c11-py2.
7
.egg
Copying setuptools-
0
.6c11-py2.
7
.egg to c:\python27\lib\site-packages
Adding setuptools
0
.6c11 to easy-install.pth file
Installing easy_install-script.py script to C:\Python27\Scripts
Installing easy_install.exe script to C:\Python27\Scripts
Installing easy_install.exe.manifest script to C:\Python27\Scripts
Installing easy_install-
2.7
-script.py script to C:\Python27\Scripts
Installing easy_install-
2.7
.exe script to C:\Python27\Scripts
Installing easy_install-
2.7
.exe.manifest script to C:\Python27\Scripts
Installed c:\python27\lib\site-packages\setuptools-
0
.6c11-py2.
7
.egg
Processing dependencies
for
setuptools==
0
.6c11
Finished processing dependencies
for
setuptools==
0
.6c11
|
再把 C:\Python27\Scripts 该路径添加到 系统的Path 变量里面,这样就可以直接使用easy_install命令了。
3.安装PyCrypto模块
由于在Windows上平台上不管使用手工编译,还是用easy_install命令对该模块进行安装的话,非常
容易出现问题,而且特别的麻烦,所以已经有人帮我们编译好了Windows平台上对应的版本,只需要下载安装即可
到这个位置下载对应的版本 pycrypto-2.6.win32-py2.7
http://www.voidspace.org.uk/python/modules.shtml#pycrypto
或者 到我的网盘进行下载
http://pan.baidu.com/share/link?shareid=3896105660&uk=839171987
安装过程,只需要下一步下一步即可。
4.使用easy_install安装paramiko模块
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
C:\Users\TestAA>easy_install paramiko
Searching
for
paramiko
Reading http:
//pypi
.python.org
/simple/paramiko/
Best match: paramiko 1.11.0
Downloading https:
//pypi
.python.org
/packages/source/p/paramiko/paramiko-1
.11.0.t
ar.gz
#md5=a2c55dc04904bd08d984533703177084
Processing paramiko-1.11.0.
tar
.gz
Running paramiko-1.11.0\setup.py -q bdist_egg --dist-
dir
c:\
users
\testaa\appdata
\
local
\temp\easy_install-rla6aa\paramiko-1.11.0\egg-dist-tmp-aynqgv
zip_safe flag not
set
; analyzing archive contents...
Adding paramiko 1.11.0 to easy-
install
.pth
file
Installed c:\python27\lib\site-packages\paramiko-1.11.0-py2.7.egg
Processing dependencies
for
paramiko
Finished processing dependencies
for
paramiko
C:\Users\TestAA>
|
进入Python导入paramiko一下看看,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
C:\Users\TestAA>python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC
v
.1500 32 bit (Intel)] on win
32
Type
"help"
,
"copyright"
,
"credits"
or
"license"
for
more
information.
>>>
import
paramiko
>>>
dir
(paramiko)
[
'AUTH_FAILED'
,
'AUTH_PARTIALLY_SUCCESSFUL'
,
'AUTH_SUCCESSFUL'
,
'Agent'
, 'AgentK
ey
', '
AuthHandler
', '
AuthenticationException
', '
AutoAddPolicy
', '
BadAuthenticati
onType
', '
BadHostKeyException
', '
BaseSFTP
', '
BufferedFile
', '
Channel
', '
ChannelE
xception
', '
ChannelFile
', '
DSSKey
', '
HostKeys
', '
InteractiveQuery
', '
Message
', '
MissingHostKeyPolicy
', '
OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
', '
OPEN_FAILED_C
ONNECT_FAILED
', '
OPEN_FAILED_RESOURCE_SHORTAGE
', '
OPEN_FAILED_UNKNOWN_CHANNEL_TY
PE
', '
OPEN_SUCCEEDED
', '
PKey
', '
Packetizer
', '
PasswordRequiredException
', '
Proxy
Command
', '
ProxyCommandFailure
', '
RSAKey
', '
RejectPolicy
', '
SFTP
', '
SFTPAttribut
es
', '
SFTPClient
', '
SFTPError
', '
SFTPFile
', '
SFTPHandle
', '
SFTPServer
', '
SFTPSer
verInterface
', '
SFTP_BAD_MESSAGE
', '
SFTP_CONNECTION_LOST
', '
SFTP_EOF
', '
SFTP_FAI
LURE
', '
SFTP_NO_CONNECTION
', '
SFTP_NO_SUCH_FILE
', '
SFTP_OK
', '
SFTP_OP_UNSUPPORTE
D
', '
SFTP_PERMISSION_DENIED
', '
SSHClient
', '
SSHConfig
', '
SSHException
', '
Securit
yOptions
', '
ServerInterface
', '
SubsystemHandler
', '
Transport
', '
WarningPolicy',
'__all__'
,
'__author__'
,
'__builtins__'
,
'__doc__'
,
'__file__'
,
'__license__'
, '
__loader__
', '
__name__
', '
__package__
', '
__path__
', '
__version__
', '
agent
', '
aut
h_handler
', '
ber
', '
buffered_pipe
', '
channel
', '
client
', '
common
', '
compress
', '
config
', '
dsskey
', '
file
', '
hostkeys
', '
io_sleep
', '
kex_gex
', '
kex_group1
', '
mes
sage
', '
packet
', '
pipe
', '
pkey
', '
primes
', '
proxy
', '
resource
', '
rsakey
', '
serve
r
', '
sftp
', '
sftp_attr
', '
sftp_client
', '
sftp_file
', '
sftp_handle
', '
sftp_server
', '
sftp_si
', '
ssh_exception
', '
sys
', '
transport
', '
util']
>>>
|
看到以上情况,说明paramiko已经成功安装了