python-minecraft-clone
python-minecraft-clone copied to clipboard
[suggestion] Import numbers imports python 3.10 numbers instead of numbers.py
When I run ep5 it import the python 3.10+ numbers library instead of importing locally. I am using the unmodified code on windows 10. I have found a possible fix by creating a file called local.py and writing:
from importlib.machinery import SourceFileLoader
import os
def local_import(library):
return(SourceFileLoader("module.name", os.path.join(os.path.dirname(os.path.realpath(__file__)), (library if library.endswith(".py") else library + ".py"))).load_module())
and in block_type.py I change import numbers line to:
import local
numbers = local.local_import("numbers")