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