-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to compile master branch, scons ModuleNotFoundError #56652
Comments
I can't reproduce this on commit b6b81e8 (Fedora 34).
4.0 is a moving target. Please specify the exact Git commit hash you're using locally when reporting issues 🙂 Does this occur if you remove system-wide SCons and install SCons from pip using |
I've been trying to compile master for a week but I'm getting the same error (arch/gnome). I'll try Calinou's proposed workaround and report back. |
I have tried the SCons from pip with the commit 7faf023 but I'm having the same error. Here is the scons stack trace:
|
I tried the SCons from pip too; same error. Commit 4948296.
|
@soloparatolos Could you try to bisect the regression to determine when this started to occur? Thanks in advance 🙂 |
There's no need to bisect, the error is clear, as this code was added in #53957. |
Cannot reproduce on Ubuntu 21.10 (Commit 8227282) |
I suspect that affected users might have a Python module named Edit: Yep, confirmed.
|
So the part that needs to be changed in:
(Same in Mono module) Not sure what's the best way to do this, I remember it was a hassle when we had to workaround similar issues with conflicts on Any suggestion @touilleMan? I guess we can do some |
That's the part of the PR where I bruteforced the thing, it would be a shame to have to duplicate the code and Moving the file, if I understand correctly, will produce the same issue if a module has the good idea to be called (core, misc, main, etc.). @jmb462 tries with |
Replacing the import line with these 4 lines does the trick. I propose that I open a PR and maybe a Python guru could confirm that it's ok. |
In a traditional Python project we should have all our code in a single folder (a "package" in Python vocabulary). This folder (and all it subfolders) would contain a This way we would be able to use relative import (e.g. However we don't have a single package here, but instead have .py files scattered around the codebase (no judgement, this is normal given Python is only used a convenient tool here ^^). The bad thing is it's not possible to differentiate between "this I see two solutions to solve this:
@jmb462 PR #56690 does 1), however I'm not convinced about this approach given it requires to ban regular Approach 2) on the other hand consist of ensuring that our helper modules are first in line when importing their name.
I think the second solution is better for our need (given we want to keep the helper code in their current folder for readability) I've created PR #56698 which implement this solution ;-) |
Godot version
4.0
System information
Debian 11
Issue description
scons report the following error:
scons: Reading SConscript files ...
ModuleNotFoundError: No module named 'editor.template_builders'; 'editor' is not a package:
Steps to reproduce
clone the master repository and try to compile with:
/usr/bin/env python3 /usr/local/bin/scons --jobs=8 platform=linuxbsd target=release_debug
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: