问题描述:Mac 电脑使用ride的时候导入requestslibrary报红处理
![](https://img.haomeiwen.com/i16679641/26d15e96d7ea068c.png)
1、首先检查是否已安装robotframework-requests
使用pip list查看已安装的内容
如果未安装就使用 pip install robotframework-requests进行安装
如果pip install robotframework-requests的时候提示已安装还是报红就看第2
![](https://img.haomeiwen.com/i16679641/75e0ca29554427e7.png)
2、已安装requestst再次导入requestslibrary还是报错说明是PYTHONPATH没有配置
在 pip install robotframework-requests查看到对应的已安装过去的路径
![](https://img.haomeiwen.com/i16679641/fa50d95b238308b2.png)
就在open ~/.bash_profile配置PYTHONPATH刚才的路径
然后source ~/.bash_profile 执行下
![](https://img.haomeiwen.com/i16679641/539fb9ffb311f7f0.png)
如果想立刻生效,则可执行下面的语句:
source ~/.bash_profile
3、如果已经配置PYTHONPATH,打开后还是爆红那就卸载requestslibrary库重新安装看看
使用pip uninstall robotframework-requests
Proceed (y/n)? 然后选择y进行卸载后重新安装
pip install robotframework-requests
再重新打开 ride.py 就可以了。
![](https://img.haomeiwen.com/i16679641/5becdf4155f0cb5b.png)
网友评论