Mac安装robotframework遇到的坑:wxpython

1、安装robot framework
sudo python -m pip install robotframework
这里的python换成本地python的路径:
终端输入命令:python2.7 which
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can’t open file ‘which’: [Errno 2] No such file or directory

终端输入:sudo /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python -m pip install robotframework

结果:Successfully installed robotframework-3.1.1

2、安装robotframework-ride

命令:sudo /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python -m pip install robotframework-ride

报错:Could not find a version that satisfies the requirement Pywin32 (from robotframework-ride) (from versions: )
No matching distribution found for Pywin32 (from robotframework-ride)

更换命令:sudo /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python -m easy_install robotframework-ride

结果:Finished processing dependencies for robotframework-ride

3、检查安装是否成功
python -m pip list

sudo /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python -m pip list

4、安装wxpython

安装brew(已安装可忽略)
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

brew install wxpython

5、执行: /usr/local/bin/ride.py
报错:wxPython not found.
You need to install wxPython 2.8.12.1 or 3.0.2 or newer with unicode support to run RIDE. wxPython can be downloaded from http://sourceforge.net/projects/wxpython/files/wxPython/

搞了很久,试着修改robotide里_init_.py里的值,不行。最后按提示的下载链接下载后配置好了。

解决wxpython方法:
6、去http://sourceforge.net/projects/wxpython/files/wxPython/下载,我下载的是wxPython3.0-osx-3.0.2.0-cocoa-py2.7.dmg,下载完成后双击打开dmg文件,然后右击pkg文件,选择"显示包内容"
Mac安装robotframework遇到的坑:wxpython_第1张图片

7、打开Contents/Resources/ ,将postflight文件复制到桌面,双击解压wxPython3.0-osx-3.0.2.0-cocoa-py2.7.pax.gz,解压后会生成usr文件夹

8、将usr中的 local/lib 拷贝到usr/local 目录下,若提示已存在lib文件夹,可以选择合并。然后运行之前拷贝到桌面上的 postflight

9、切换到post flight所在的目录,运行命令:sudo ./postflight,结果会看到打印很多Listing /usr/local/lib/wxPython-3.0.2.0/lib/python2.7/site-packages/wx-3.0-osx_cocoa …

10、最后运行ride.py:/usr/local/bin/ride.py

最后打开ride成功啦!

你可能感兴趣的:(自动化)