Install Paramiko on CentOS7 Python3

Source: Internet
Author: User

1. CentOS 7 installation Python3.5

CentOS7 installed python2.7.5 By default, you need to install it manually with Python3. Be careful not to delete Python2.

1.1 Download Python3 Source Package

wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz

< Span style= "Font-family:verdana, Arial, Helvetica, Sans-serif; font-size:14px ">1.2 installation dependent

< Span style= "Font-family:verdana, Arial, Helvetica, Sans-serif; font-size:14px ">     yum install openssl-devel libxslt-devel -y

1.3 Unzip the source package and compile the installation.

TAR-XVF python-3.5.2.tgz

   ./configure--prefix=/usr/python3.5

    make

Make install

1.4  add Python3 to the system environment

#vi/etc/profile export path= $PATH:/usr/python3.5/bin

# Source/etc/profile

At this point, the command line input Python3 can use Python3.

2. Installing Paramiko

Python3 brought the PIP3. Install Paramiko directly with PIP3 for Python3. If you use Pip install, it is installed on Python 2.7.

PIP3 Install Paramiko

3. Download Paramiko Source code Verification

3.1 Download Paramiko source from GitHub

Wget-c Https://github.com/paramiko/paramiko/archive/master.zip

3.2 After decompression, enter the demos directory.

Python3 demo.py

Input want to SSH hostname, username, password can log on to this machine.

Note: If an error occurs after entering the password, it resembles

File "E:\PycharmProjects\oldboy\day13\demos\interactive.py", line +, in write all Sys.stdout.write (data) Typeerror:mu ST is str, not bytes

Just modify demos\interactive.py line 84th

Sys.stdout.write (Datadecode ()) decode data to Str. 

Install Paramiko on CentOS7 Python3

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.