pycharm中导入allure提示模块不存在解决方法

已经使用pip安装allure,但在pycharm中导入allure模块,提示allure模块不存在,如图:

pycharm中导入allure提示模块不存在解决方法

解决方法:

  1. pycharm中点击【Preference】--》【Project Interpreter】,然后点击左下角的【+】按钮,如图pycharm中导入allure提示模块不存在解决方法
  2. 输入“allure”进行搜索,然后选择“allure-pytest”,点击左下角的【Install Package】,如图pycharm中导入allure提示模块不存在解决方法
  3. 安装成功,如图pycharm中导入allure提示模块不存在解决方法
  4. 返回编辑区,问题解决pycharm中导入allure提示模块不存在解决方法