Robotframework“失败:ImportError:没有命名为请求的模块”

2024-06-28 14:55:59 发布

您现在位置:Python中文网/ 问答频道 /正文

安装此模块时出现“No module named requests”错误(错误后的详细信息):

[ ERROR ] Error in file '/Users/adikeller/Applications/GIT/BeAm/Beacon_4.10/STABILITY/beacon_stability_random_beacon_types.txt': Importing test library 'BeAm.beacon.tests.BeaconTesting' failed: ImportError: No module named requests
Traceback (most recent call last):
  File "/Users/adikeller/Applications/GIT/BeAm/BeAm/beacon/tests.py", line 5, in <module>
    from BeAm.beacon.counters import BeaconCounter
  File "/Users/adikeller/Applications/GIT/BeAm/BeAm/beacon/counters.py", line 1, in <module>
    import requests
PYTHONPATH:
  /Users/adikeller/vevn/bin
  /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg
  /Users/adikeller/Applications/GIT/BeAm
  /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
  /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
  /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
  /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
  /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
  /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
  /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
  /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
  /Library/Python/2.7/site-packages
  /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
  /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC

我已经做过的事情:

  1. 向PYTHONPATH添加工作目录: export PYTHONPATH=$PYTHONPATH:/Users/adikeler/Applications/GIT/BeAm
  2. 安装的“请求”模块: sudo pip安装请求
  3. pip冻结: ... 请求==0.0.22 请求==2.18.3 机器人==20071211 机器人框架==3.0.2 robotframework数据库库==0.8.1 robotframework-DiffLibrary2==0.0.2.dev0 robotframework httplibrary==0.4.2 robotframework pycurllibrary==0.9.5 机器人框架rammbock==0.4.0.1 robotframework请求==0.4.5 robotframework乘坐==1.5.2.1 robotframework-Selenium2库==1.7.4 机器人框架sshlibrary==2.1.2 ... 在

附加信息:

  1. 我用MacBook macOS Sierra(10.12.6版)
  2. 我在virtualenv中运行,我在其中,所有模块都安装在那里。在
  3. 我在跑步文件夹中找到了: /用户/adikeller/Applications/GIT/BeAm
  4. 运行命令行:
    pybot Beacon_4.10/STABILITY/Beacon_稳定性_random_Beacon_类型.txt在

信标稳定性随机信标_类型.txt公司名称:

^{pr2}$

Tags: gitliblibraryframeworkversionssystemusersrobotframework