欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

基于Python在MacOS上安裝robotframework-ride

 更新時(shí)間:2018年12月28日 14:12:19   作者:liumiaocn  
今天小編就為大家分享一篇關(guān)于基于Python在MacOS上安裝robotframework-ride,小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧

Robotframework是一個(gè)框架,是一個(gè)可以用于關(guān)鍵字測(cè)試驅(qū)動(dòng)的框架。而RIDE(robotframework-ride)就是可以使得寫robot測(cè)試用例更加方便快捷的IDE圖形操作工具。

安裝

因?yàn)槭腔趐ython的,所以其可以運(yùn)行在多個(gè)操作系統(tǒng)上。這里主要介紹一下RIDE在MacOS上的使用方式。

OS版本

MacOS版本:10.13.2

wxpython

由于RIDE是基于wxpython的應(yīng)用,所以首先需要保證wxpython已經(jīng)得到了安裝。安裝命令如下:

安裝命令:brew install wxpython

安裝日志

liumiaocn:~ liumiao$ brew install wxpython
==> Installing dependencies for wxpython: gdbm, readline, sqlite, python@2, jpeg, libpng, libtiff, wxmac
==> Installing wxpython dependency: gdbm
==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.15.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring gdbm-1.15.high_sierra.bottle.tar.gz
? /usr/local/Cellar/gdbm/1.15: 19 files, 569.8KB
==> Installing wxpython dependency: readline
==> Downloading https://homebrew.bintray.com/bottles/readline-7.0.3_1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring readline-7.0.3_1.high_sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.
For compilers to find this software you may need to set:
  LDFLAGS: -L/usr/local/opt/readline/lib
  CPPFLAGS: -I/usr/local/opt/readline/include
==> Summary
? /usr/local/Cellar/readline/7.0.3_1: 46 files, 1.5MB
==> Installing wxpython dependency: sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.24.0.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring sqlite-3.24.0.high_sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.
If you need to have this software first in your PATH run:
 echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile
For compilers to find this software you may need to set:
  LDFLAGS: -L/usr/local/opt/sqlite/lib
  CPPFLAGS: -I/usr/local/opt/sqlite/include
For pkg-config to find this software you may need to set:
  PKG_CONFIG_PATH: /usr/local/opt/sqlite/lib/pkgconfig
==> Summary
? /usr/local/Cellar/sqlite/3.24.0: 11 files, 3.5MB
==> Installing wxpython dependency: python@2
==> Downloading https://homebrew.bintray.com/bottles/python@2-2.7.15_1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring python@2-2.7.15_1.high_sierra.bottle.tar.gz
==> /usr/local/Cellar/python@2/2.7.15_1/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-mana
==> /usr/local/Cellar/python@2/2.7.15_1/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-mana
==> /usr/local/Cellar/python@2/2.7.15_1/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-mana
==> Caveats
Pip and setuptools have been installed. To update them
 pip install --upgrade pip setuptools
You can install Python packages with
 pip install <package>
They will install into the site-package directory
 /usr/local/lib/python2.7/site-packages
See: https://docs.brew.sh/Homebrew-and-Python
==> Summary
? /usr/local/Cellar/python@2/2.7.15_1: 4,673 files, 82.8MB
==> Installing wxpython dependency: jpeg
==> Downloading https://homebrew.bintray.com/bottles/jpeg-9c.high_sierra.bottle.tar.gz
curl: (6) Could not resolve host: akamai.bintray.com
Error: Failed to download resource "jpeg"
Download failed: https://homebrew.bintray.com/bottles/jpeg-9c.high_sierra.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading http://www.ijg.org/files/jpegsrc.v9c.tar.gz
######################################################################## 100.0%
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/jpeg/9c
==> make install
? /usr/local/Cellar/jpeg/9c: 21 files, 749.8KB, built in 33 seconds
==> Installing wxpython dependency: libpng
==> Downloading https://homebrew.bintray.com/bottles/libpng-1.6.34.high_sierra.bottle.tar.gz
curl: (6) Could not resolve host: akamai.bintray.com
Error: Failed to download resource "libpng"
Download failed: https://homebrew.bintray.com/bottles/libpng-1.6.34.high_sierra.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading https://downloads.sourceforge.net/libpng/libpng-1.6.34.tar.xz
==> Downloading from https://downloads.sourceforge.net/project/libpng/libpng16/1.6.34/libpng-1.6.34.tar.xz
######################################################################## 100.0%
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/libpng/1.6.34
==> make
==> make test
==> make install
? /usr/local/Cellar/libpng/1.6.34: 26 files, 1.2MB, built in 1 minute 38 seconds
==> Installing wxpython dependency: libtiff
==> Downloading https://homebrew.bintray.com/bottles/libtiff-4.0.9_3.high_sierra.bottle.tar.gz
curl: (6) Could not resolve host: akamai.bintray.com
Error: Failed to download resource "libtiff"
Download failed: https://homebrew.bintray.com/bottles/libtiff-4.0.9_3.high_sierra.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading https://download.osgeo.org/libtiff/tiff-4.0.9.tar.gz
curl: (28) Resolving timed out after 5551 milliseconds
Trying a mirror...
==> Downloading https://fossies.org/linux/misc/tiff-4.0.9.tar.gz
#########################                         34.8%
######################################################################## 100.0%
==> Downloading https://mirrors.ocf.berkeley.edu/debian/pool/main/t/tiff/tiff_4.0.9-5.debian.tar.xz
######################################################################## 100.0%
==> Patching
==> Applying patches/CVE-2017-9935.patch
patching file libtiff/tif_dir.c
patching file tools/tiff2pdf.c
==> Applying patches/CVE-2017-18013.patch
patching file libtiff/tif_print.c
==> Applying patches/CVE-2018-5784.patch
patching file contrib/addtiffo/tif_overview.c
patching file tools/tiff2pdf.c
patching file tools/tiffcrop.c
==> Applying patches/CVE-2017-11613_part1.patch
patching file libtiff/tif_dirread.c
==> Applying patches/CVE-2017-11613_part2.patch
patching file libtiff/tif_dirread.c
==> Applying patches/CVE-2018-7456.patch
patching file libtiff/tif_dirread.c
patching file libtiff/tif_print.c
==> Applying patches/CVE-2017-17095.patch
patching file tools/pal2rgb.c
==> ./configure --prefix=/usr/local/Cellar/libtiff/4.0.9_3 --without-x --with-jpeg-include-dir=/usr/local/opt/jpeg/include --with-jpeg-
==> make install
? /usr/local/Cellar/libtiff/4.0.9_3: 246 files, 3.5MB, built in 5 minutes 10 seconds
==> Installing wxpython dependency: wxmac
==> Downloading https://homebrew.bintray.com/bottles/wxmac-3.0.4.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring wxmac-3.0.4.high_sierra.bottle.tar.gz
? /usr/local/Cellar/wxmac/3.0.4: 810 files, 23.7MB
==> Installing wxpython
==> Downloading https://homebrew.bintray.com/bottles/wxpython-3.0.2.0_1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring wxpython-3.0.2.0_1.high_sierra.bottle.tar.gz
? /usr/local/Cellar/wxpython/3.0.2.0_1: 1,108 files, 37.9MB
liumiaocn:~ liumiao$ 

版本確認(rèn)

liumiaocn:~ liumiao$ brew info wxpython
wxpython: stable 3.0.2.0 (bottled)
Python bindings for wxWidgets
https://www.wxwidgets.org/
/usr/local/Cellar/wxpython/3.0.2.0_1 (1,115 files, 39.9MB) *
 Poured from bottle on 2018-06-19 at 15:52:25
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/wxpython.rb
==> Dependencies
Required: python@2 ✔, wxmac ✔
liumiaocn:~ liumiao$

暫定對(duì)應(yīng)1:wxpython安裝之后,目前的版本還缺少一個(gè)軟連接才能正常動(dòng)作,根據(jù)日志可以看到此次安裝的wxpython版本為wxpython-3.0.2.0_1, 按照如下操作創(chuàng)建軟連接即可

創(chuàng)建鏈接

liumiaocn:bin liumiao$ pwd
/usr/local/bin
liumiaocn:bin liumiao$ ls wx
ls: wx: No such file or directory
liumiaocn:bin liumiao$ ln -s ../Cellar/wxpython/3.0.2.0_1/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx wx
liumiaocn:bin liumiao$

確認(rèn)方式

liumiaocn:~ liumiao$ python -c "import wx; print wx.VERSION"
/usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_core.py:16633: UserWarning: wxPython/wxWidgets release number mismatch
 warnings.warn("wxPython/wxWidgets release number mismatch")
(3, 0, 2, 0, '')
liumiaocn:~ liumiao$

雖然仍然提示warning信息,但是已經(jīng)能夠正常繼續(xù)動(dòng)作了。

安裝robotframework-ride

使用pip安裝robotframework-ride, 安裝命令如下

安裝命令:pip install robotframework-ride

啟動(dòng)確認(rèn)

通過(guò)ride.py啟動(dòng)RIDE,當(dāng)前版本出現(xiàn)了如下錯(cuò)誤信息

liumiaocn:bin liumiao$ ride.py
Wrong wxPython version.
You need to install wxPython 2.8.12.1 with unicode support to run RIDE.
wxPython 2.8.12.1 can be downloaded from http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/
liumiaocn:bin liumiao$

原因確認(rèn):經(jīng)過(guò)定位代碼中錯(cuò)誤出現(xiàn)的位置,確認(rèn)到如下文件:

liumiaocn:local liumiao$ find . -name '*.py' |xargs grep 'You need to install wxPython'
./lib/python2.7/site-packages/robotide/__init__.py:You need to install wxPython 2.8.12.1 with unicode support to run RIDE.
liumiaocn:local liumiao$ view ./lib/python2.7/site-packages/robotide/__init__.py
liumiaocn:local liumiao$ grep supported_versions ./lib/python2.7/site-packages/robotide/__init__.py
supported_versions = ["2.8"]
    supported_versions.append("2.9")
  wxversion.select(supported_versions)
liumiaocn:local liumiao$

對(duì)應(yīng)方法1:直接將支持的版本號(hào)修改為當(dāng)前的版本

liumiaocn:~ liumiao$ diff /usr/local/lib/python2.7/site-packages/robotide/__init__.py /usr/local/lib/python2.7/site-packages/robotide/__init__.py.org
37,38c37
< #supported_versions = ["2.8"]
< supported_versions = ["3.0.2.0"]
---
> supported_versions = ["2.8"]
liumiaocn:~ liumiao$

對(duì)應(yīng)方法2:添加supported_versions

liumiaocn:~ liumiao$ diff /usr/local/lib/python2.7/site-packages/robotide/__init__.py /usr/local/lib/python2.7/site-packages/robotide/__init__.py.org
44d43
<     supported_versions.append("3.0.2.0")
liumiaocn:~ liumiao$

實(shí)際上在如下行添加了對(duì)當(dāng)前版本的支持

 try:
   import wxversion
   from wxversion import VersionError
   if sys.platform == 'darwin':
     supported_versions.append("2.9")
     supported_versions.append("3.0.2.0")
   wxversion.select(supported_versions)
   import wx

安裝robotframework

使用pip install robotramework進(jìn)行robotframework的安裝

liumiaocn:~ liumiao$ pip install robotframework
Collecting robotframework
 Downloading https://files.pythonhosted.org/packages/95/b1/4faa12e1950b9fbd00060c112fa6f828c4f3998e9b2f8c570c22db10bc88/robotframework-3.0.4.tar.gz (443kB)
  100% |████████████████████████████████| 450kB 34kB/s 
Building wheels for collected packages: robotframework
 Running setup.py bdist_wheel for robotframework ... done
 Stored in directory: /Users/liumiao/Library/Caches/pip/wheels/8a/01/4a/fd9aef57cca0087d0bd5ceba5db39247ef375fdc4df5ebfb59
Successfully built robotframework
Installing collected packages: robotframework
Successfully installed robotframework-3.0.4
liumiaocn:~ liumiao$

啟動(dòng)RIDE

在命令行輸入ride.py并回車,便可啟動(dòng)RIDE

安裝pygments

Text Edit的tab提示需要安裝高亮顯示用的包pygments

使用pip install pygments進(jìn)行安裝

liumiaocn:~ liumiao$ pip install pygments
Collecting pygments
 Downloading https://files.pythonhosted.org/packages/02/ee/b6e02dc6529e82b75bb06823ff7d005b141037cb1416b10c6f00fc419dca/Pygments-2.2.0-py2.py3-none-any.whl (841kB)
  100% |████████████████████████████████| 849kB 1.9MB/s 
Installing collected packages: pygments
Successfully installed pygments-2.2.0
liumiaocn:~ liumiao$

再次啟動(dòng)ride.py,已經(jīng)可以正常動(dòng)作了。

總結(jié)

以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,謝謝大家對(duì)腳本之家的支持。如果你想了解更多相關(guān)內(nèi)容請(qǐng)查看下面相關(guān)鏈接

相關(guān)文章

  • 在?Python?中如何為對(duì)象添加屬性

    在?Python?中如何為對(duì)象添加屬性

    在本文中我們將介紹如何在Python中為對(duì)象添加屬性,我們還將通過(guò)示例介紹如何在Python中更改對(duì)象的屬性,本文通過(guò)示例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友參考下吧
    2023-06-06
  • python Flask框架之HTTP請(qǐng)求詳解

    python Flask框架之HTTP請(qǐng)求詳解

    Flask是一個(gè)使用 Python 編寫的輕量級(jí) Web 應(yīng)用框架。其 WSGI 工具箱采用 Werkzeug ,模板引擎則使用 Jinja2 。Flask使用 BSD 授權(quán),本篇我們來(lái)了解Flask框架中的HTTP請(qǐng)求
    2022-07-07
  • python中sets模塊的用法實(shí)例

    python中sets模塊的用法實(shí)例

    這篇文章主要介紹了python中sets模塊的用法實(shí)例,該模塊用來(lái)處理集合類型的數(shù)據(jù),在這個(gè)模塊中提供了兩個(gè)集合類:Set(可變集合)和ImmurableSet(不可變集合),本文實(shí)例主要分析了Set(可變集合)的用法,需要的朋友可以參考下
    2014-09-09
  • 使用python快速實(shí)現(xiàn)不同機(jī)器間文件夾共享方式

    使用python快速實(shí)現(xiàn)不同機(jī)器間文件夾共享方式

    今天小編就為大家分享一篇使用python快速實(shí)現(xiàn)不同機(jī)器間文件夾共享方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2019-12-12
  • python如何構(gòu)建mock接口服務(wù)

    python如何構(gòu)建mock接口服務(wù)

    這篇文章主要介紹了python如何構(gòu)建mock接口服務(wù),幫助大家更好的理解和使用python,感興趣的朋友可以了解下
    2021-01-01
  • 用python編寫一個(gè)圖片拼接工具

    用python編寫一個(gè)圖片拼接工具

    大家好,本篇文章主要講的是用python編寫一個(gè)圖片拼接工具,感興趣的同學(xué)趕快來(lái)看一看吧,對(duì)你有幫助的話記得收藏一下
    2022-01-01
  • Pandas中DataFrame的基本操作之重新索引講解

    Pandas中DataFrame的基本操作之重新索引講解

    這篇文章主要介紹了Pandas中DataFrame的基本操作之重新索引,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-07-07
  • python的scipy.stats模塊中正態(tài)分布常用函數(shù)總結(jié)

    python的scipy.stats模塊中正態(tài)分布常用函數(shù)總結(jié)

    在本篇內(nèi)容里小編給大家整理的是一篇關(guān)于python的scipy.stats模塊中正態(tài)分布常用函數(shù)總結(jié)內(nèi)容,有興趣的朋友們可以學(xué)習(xí)參考下。
    2021-02-02
  • 一文詳解Python中的subprocess模塊

    一文詳解Python中的subprocess模塊

    subprocess模塊是Python標(biāo)準(zhǔn)庫(kù)的一部分,提供了一個(gè)跨平臺(tái)的方法來(lái)生成新進(jìn)程、連接其輸入/輸出/錯(cuò)誤管道,并獲取其返回碼,本文小編將和大家一起深入理解Python中的subprocess模塊,感興趣的小伙伴跟著小編一起來(lái)看看吧
    2024-08-08
  • 200行自定義python異步非阻塞Web框架

    200行自定義python異步非阻塞Web框架

    本篇將使用200行代碼完成一個(gè)微型異步非阻塞Web框架:Snow。具有很好的參考價(jià)值,下面跟著小編一起來(lái)看下吧
    2017-03-03

最新評(píng)論