Attribute error : module "pytest" has no attribute "hookimpl"

Viewed 1721

I have installed python 3.8.3 in windows 8/64 bit.. I need to start with pytest...path has been set properly... In Pycharm I am getting

Attribute error : module "pytest" has no attribute "hookimpl"

All the plugins installed as per the latest version

3 Answers

Pytest doesn't supports Python 3.8 yet. Supported versions for Pytest

  • Python 3.5
  • Python 3.6
  • Python 3.7
  • PyPy3

Create a new virtualenv in Pycharm with these versions. If you don't know how here is a link for you. Pycharm Configuring Python Interpreter

Also if you are interested you can find more info about Pytest Installation

There appears to be an issue with a Magic String here. Make sure you dont have any file named identically to any internal python code. I changed my package name from 'pytest' to 'pytestdemo' and this error was resolved.

Check your pytest project/package name, it should not start with 'Test'. I got same issue when project/package name was "Test". Changing the project/package name solved the issue.

Related