python的自动化模块安装

以前所用的操作系统是centos,如今用的操作系统是debian,所以开始适应,转变。

debian安装之后发现默认没有安装ssh,所以先安装ssh服务并启动

apt-get install ssh
/etc/init.d/ssh start

接下来安装pexpect,paramiko模块。

若要安装上面的模块,先安装setuptools模块。

  1. 安装setuptools模块

wget 
tar xf  setuptools-3.3.tar.gz
cd setuptools-3.3
python setup.py build
python setup.py install

2.安装setuptools模块之后就可以使用easy_install指令来安装了。

easy_install paramiko pexpect

在安装时常碰到的问题是:

gcc没有安装,或python-dev没有安装

常见的错误提示信息如下

configure: error: in `/tmp/easy_install-c2hYP5/pycrypto-2.6.1':
configure: error: no acceptable C compiler found in $PATH
src/MD2.c:31:20: fatal error: Python.h: No such file or directory
 #include "Python.h"

解决办法:

在/etc/apt/sources.list文件中假如下面两行
deb http://mirrors.xmission.com/debian/ testing main non-free contrib
deb http://http.us.debian.org/debian testing main contrib non-free
并执行指令:
apt-get update
apt-get install gcc make autoconf automake
apt-get install python-dev

上面的包安装之后,这样paramiko和pexpect模块便可正常安装了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章