flit: ModuleNotFoundError: No module named 'flit_core.dummy'

I’m building my project with

[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

and since earlier today I’m getting the error message

      [...]
      ModuleNotFoundError: No module named 'flit_core.dummy'
      [end of output]

when running pip install . on the repo. Perhaps I messed up something in the package, but the error message points towards flit. Any idea what’s going on?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 18
  • Comments: 22 (11 by maintainers)

Commits related to this issue

Most upvoted comments

OK, it seems like #531 fixes this. I’ll merge that and make a new release (3.7.1).

Again, I know this issue is going to affect a lot of people. There will hopefully be a fix soon. In the meantime, please 👍 the initial comment if you just want to say ‘me too’. Thanks!

Yup, I have the version number in __about__.py, and it’s imported from there in __init__.py and other places. That’s how I ran into the issue.

This is almost certainly related to #499. Based on the logs here and in #529, I’d guess this occurs when a) it can’t get __version__ by static analysis, so it falls back to running code, and b) __init__.py contains a relative import.

It looks like this is going to hit a load of people - sorry about that. I’ll ask people now: please don’t comment just to say it affects you too (you can click the 👍 under the first comment).

I am pretty busy, so any help working out how to deal with this is welcome. Besides #499, you might want to look at commit 432dc76245d6564a150cb2e485db12f6c2a1836e where the ‘dummy’ module names were introduced, and the backwards-compatibility implementation of load_module in importlib which we were using before the changes in #499.