zoukankan      html  css  js  c++  java
  • 在Mac 搭建robotframework 环境

    折腾来一下午,遇到了好多坑

    1.不要用pip 下载wxpython

    2.不要用mac自带的python

    3.不要自己下载wxpython

    步骤:

    1. 安装homebrew, 

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    2. 通过homebrew安装python2.6或2.7, 理由是robotframework ride只支持2.6-2.7版本,  详情请看 https://github.com/robotframework/RIDE/wiki/Installation-Instructions

    可以通过brew search python 命令查询可以下载的python版本,然后在根据具体名称下载 brew install python2

    3. 配置~/.bash_profile 文件, 将brew 下载的python配置到bash_profile文件中,正常目录如下:

    /usr/local/Cellar/python/2.7.13_1/bin

     

    4. 然后通过pip下载robotframework-ride 

    pip install robotframework-ride

    5. 通过brew下载wxpython, brew下载的默认是最新的稳定版, 目前是

    wxpython: stable 3.0.2.0 (bottled)

     

     此时执行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/

    为了解决这个,网上很多方法都是要去下载安装2.8.12.1版本, 各种安装方法最后都不可以,解决办法就是修改ride所支持的版本范围,加上3.0版本就可以了,是参考:

    http://widerin.net/blog/install-robot-framework-ride-through-homebrew/

    找到当前python使用的site-packages目录, 如何查找请在python命令下输入以下命令就可以获得

    import site; site.getsitepackages()
    /usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages

     找到robotide 文件夹下的__init__.py 文件, 增加3.0支持

    try:
        import wxversion
        from wxversion import VersionError
        if sys.platform == 'darwin': # CAN NOT IMPORT IS_MAC AS THERE IS A wx IMPORT
            supported_versions.append("2.9")
            supported_versions.append("3.0")
        wxversion.select(supported_versions)
        import wx

     然后重新执行ride.py就大功告成了!

    亲测有效!

  • 相关阅读:
    windows设置文件夹显示缩略图
    windows合并文件夹窗口
    crm高速开发之Entity
    在Eclipse中搭建Dagger和Dagger2使用环境
    CCEditBox/CCEditBoxImpl
    failed to sync branch You might need to open a shell and debug the state of this repo.
    五个方法:让站点用心服务于每一位客户
    Mobile first! Wijmo 5 + Ionic Framework之:Hello World!
    ST Nucleo mbed套件开发 一 MBED环境使用 以Nucleo-F401为例 (二)
    关于Windows通过远程桌面訪问Ubuntu
  • 原文地址:https://www.cnblogs.com/xiaoningz/p/7275338.html
Copyright © 2011-2022 走看看