How to install paramiko in python3.5 in windows

Source: Internet
Author: User
Recently, due to some requirements, I had to work on python, so I had to work on it over the weekend. to connect to the server and perform some server operations, install the Paramiko package. For more information, see # wiki/1514.html "target =" _ blank "> python, so we started this weekend. to connect to the server and perform some server operations, install this Paramiko package and directly

pip install paramiko

Result: an error is reported. The most important sentence is:

error: Unable to find vcvarsall.bat

Google circle. finally, find the simplest method. other installation. installing MinGW is too complicated. install the third-party version of PyCrypto because paramiko depends on PyCrypto. the above error is reported by him. install PyCrypto third-party edition

pip install --use-wheel --no-index --find-links=https://github.com/sfbahr/PyCrypto-Wheels/raw/master/pycrypto-2.6.1-cp35-none-win_amd64.whl pycrypto


After the installation is complete, install paramiko again. 2. modify nt. py to install the above steps and write a simple program to test

#-*-Coding: UTF-8 -*-#! /Usr/bin/python import paramikoimport threadingdef ssh2 (ip, username, passwd, cmd): try: ssh = paramiko. SSHClient () ssh. set_missing_host_key_policy (paramiko. autoAddPolicy () ssh. connect (ip, 22, username, passwd, timeout = 5) for m in cmd: stdin, stdout, stderr = ssh.exe c_command (m) out = stdout. readlines () # screen output for o in out: print (o) print ('% s \ tOK \ n' % (ip) ssh. close () failed t: print ('% s \ tError \ n' % (ip) if name = 'main ': cmd = ['find/home/admin/logs/-mtime + 3-name \'*. log. * \ '-exec rm-rf {}\; '] # List of commands you want to execute username = "admin" # username passwd = "password" # password threads = [] # multithreading ip = "127.0.0.1" print ("Begin .. .... ") a = threading. thread (target = ssh2, args = (ip, username, passwd, cmd). start () input ()

Running error.

ImportError: No module named 'winrandom'


Find the installation directory of python3.5

Lib\site-packages\Crypto\Random\OSRNG

The nt. py file

import winrandom

Change

from . import winrandom

Run OK again. very simple

The above describes how to install paramiko in python3.5 in windows. For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.