以下用到的包可在網(wǎng)盤下載,也可自行到網(wǎng)頁內(nèi)下載最新版窟她,目前網(wǎng)盤內(nèi)均為最新版本
https://pan.baidu.com/s/1c2tZfaS
密碼:qxwe
下載好后可以用SecureFX上傳至服務(wù)器中
一媳危、安裝Python
python下載地址:
https://www.python.org/downloads/
安裝python
[root@centos7 mnt]# tar -zvxf Python-3.6.4.tgz
[root@centos7 mnt]# mkdir /usr/local/python3.6
[root@centos7 mnt]# cd Python-3.6.4
[root@centos7 Python-3.6.4]# ./configure --prefix=/usr/local/python3.6
如果報(bào)以下錯(cuò)誤:
解決方法:安裝gcc
配置好本地yum源后抓于,安裝gcc
[root@centos7 yum.repos.d]# yum install gcc
繼續(xù)安裝python
[root@centos7 Python-3.6.4]# ./configure --prefix=/usr/local/python3.6?--enable-optimizations
......
[root@centos7 Python-3.6.4]# make && make install
如果編譯過程中有出現(xiàn)"zipimport.ZipImportError: can't decompress data; zlib not available"錯(cuò)誤提示魁瞪,如下圖:
解決方法:yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel make
不能忽略相關(guān)包谣旁,我之前就沒有安裝readline-devel導(dǎo)致執(zhí)行python模式無法使用鍵盤的上下左右鍵;
重新make && make install
mv python python.bak #備份原來的python
ln -s /usr/local/python3.6/bin/python3.6 /usr/bin/python #關(guān)聯(lián)系統(tǒng)默認(rèn)版本為python3.6
查看Python版本
python –V
修改yum配置(否則yum無法正常運(yùn)行)
vi /usr/bin/yum
將第一行的#!/usr/bin/python修改為系統(tǒng)新的地址#!/usr/bin/python2
同理?vi /usr/libexec/urlgrabber-ext-down 文件里面的#! /usr/bin/python 也要修改為#! /usr/bin/python2
二桥胞、安裝robotframework
robotframework下載地址:
https://pypi.python.org/pypi/robotframework#downloads
安裝robotframework
[root@centos7 mnt]# tar -zvxf robotframework-3.0.2.tar.gz
[root@centos7 mnt]# chmod 755 robotframework-3.0.2
[root@centos7 mnt]# cd robotframework-3.0.2
[root@centos7 robotframework-3.0.2]# python setup.py install
……
查看是否安裝成功
[root@centos7 robotframework-3.0.2]# pybot --version
Robot Framework 3.0.2 (Python 3.6.4 on linux2)
問題:robotframework都安裝到哪里了恳守?
[root@centos7 robotframework-2.9]# find / -name robot
四、安裝robotframework-selenium2library
robotframework-selenium2library下載地址
https://pypi.python.org/pypi/robotframework-selenium2library/
[root@centos7?mnt]# tar -zvxf robotframework-selenium2library-3.0.0
[root@centos7?mnt]# chmod 755?robotframework-selenium2library-3.0.0
[root@centos7?mnt]# cd?robotframework-selenium2library-3.0.0
[root@centos7? robotframework-selenium2library-3.0.0]#?python setup.py install
檢測(cè)Selenium2Library是否安裝成功
[root@centos7?? robotframework-selenium2library-3.0.0]# python
>>> import Selenium2Library
>>>
如上贩虾,沒報(bào)錯(cuò)催烘,則說明安裝成功