python安裝paramiko模組

來源:互聯網
上載者:User

標籤:

一、相依模組

  PyCrypto - The Python Cryptography Toolkit

  二、

        $ wget http://www.lag.net/paramiko/download/paramiko-1.7.6.tar.gz

   $ wget http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.4.1.tar.gz

     或者wget http://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.0.1.tar.gz#md5=277aa00f27cfbb08f21063f4beb6de59

  三、安裝

  1、安裝pycrypto

  1.      $ tar -zxvf pycrypto-2.0.1.tar.gz  
  2.   
  3.       $ cd pycrypto-2.0.1  
  4.   
  5.       $ python setup.py build  
  6.   
  7.       $ sudo python setup.py install  

 

 

  2、安裝paramiko  

  1. $ tar -zxvf paramiko-1.7.6.tar.gz  
  2.   
  3. $ cd paramiko-1.7.6  
  4.   
  5. $ python setup.py build  
  6.   
  7. $ sudo python setup.py install  

  四、可能遇到的問題及解決「基於CentOS,Ubuntu,Python 2.7.3 」

 

  如果在安裝pycrypto2.0.1時發生如下錯誤

        command ‘gcc‘ failed with exit status 1

  view plain <strong>[/pycrypto-2.0.1]$ sudo python setup.py build running build running build_py running build_ext building ‘Crypto.Hash.MD2‘ extension gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector ——param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC -Isrc/ -I/usr/include/python2.4 -c src/MD2.c -o build/temp.linux-x86_64-2.4/src/MD2.o unable to execute gcc: No such file or directory error: command ‘gcc‘ failed with exit status 1</strong>解決方案1:

  可能是缺少pyton-dev安裝包導致

       CentOS 系統

  1. </pre>        <pre name="code" class="html">   $  yum list | grep python-dev  
  2.   
  3.   $ yum -y install python-dev*     「需root許可權執行」  



        Ubuntu 系統

  1. $sudo apt-get install python-dev  



 

  執行後,重新安裝即可成功。

  解決方案2:

  如果解決方案1還不能解決問題,可能是“gcc”沒有安裝或者不再PATH中

  $ whereis gcc         「檢查gcc」

  $  echo $PATH        「檢查gcc是否在PATH中」

  如果沒有安裝 “gcc” ,執行如下命令

        CentOS:

        $ yum list | grep gcc

  $ sudo yum install -y gcc.x86_64

       Ubuntu

        $ sudo apt-get install gcc

  執行後,重新安裝即可。

python安裝paramiko模組

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.