Python: ImportError: No module named _pluggy
Asked Answered
K

1

8

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?

Kiangsi answered 19/12, 2017 at 10:18 Comment(3)
github.com/pytest-dev/pytest/issues/2960 mentions that particular error - is that any help?Luthern
@Luthern Awesome. Upgrading pytest-metadata solved the issue. ThanksKiangsi
Excellent, glad it fixed the problem!Luthern
K
7

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
Kiangsi answered 21/12, 2017 at 8:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.