Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: ImportError: No module named _pluggy

I am getting ImportError: No module named _pluggy error when running tests using pytest.

Then I tried installing pluggy using pip install pluggy. It installs pluggy==0.6.0 successfully, but is still giving the error.

Versions List (From running pip freeze | grep pytest)

  • pytest==3.3.1
  • pytest-cov==2.5.1
  • pytest-metadata==1.5.0
  • pytest-runner==3.0
  • pluggy==0.6.0
  • Python 2.7.12

Shown below is the stack trace

Tests run successfully when run in a virtualenv. What are the possible causes which can cause this error in a non-virtualenv environment?

like image 780
Pubudu Dodangoda Avatar asked Dec 19 '17 10:12

Pubudu Dodangoda


1 Answers

As it was pointed out by @bouteillebleu the issue was in pytest-metadata package.

The solution was to upgrade the package

pip install --upgrade pytest-metadata
like image 153
Pubudu Dodangoda Avatar answered Sep 30 '22 06:09

Pubudu Dodangoda