Skip to content

ModuleNotFoundError: No module named 'xxx' #2287

Closed
@mloskot

Description

@mloskot

I'm using Python 3.6 and pytest 3.0.6, on Windows and Linux.

I have noticed a strange issue. Here is a test project which I used to reproduce the problem: https://github.com/mloskot/python-package/

  1. Go to root folder of the project

  2. Run pytest command and observe the error (see failing Travis CI build 1):

E   ModuleNotFoundError: No module named 'pets'
  1. Run python -m pytest command and observe successful run, with all modules under test being found (see Travis CI build 2)

AFAIK, both commands are equivalent.

The only bug report related to ModuleNotFoundError and Python 3.6 I found is #2132 but I'm not sure if this is related in any way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questiongeneral question, might be closed after 2 weeks of inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions