overhangio / tutor-mfe

This plugin makes it possible to easily add micro frontend (MFE) applications on top of an Open edX platform that runs with Tutor.
GNU Affero General Public License v3.0
22 stars 95 forks source link

ModuleNotFoundError: No module named 'importlib_resources' when enabling tutor-mfe 17.0.1 #217

Closed Silidrone closed 5 months ago

Silidrone commented 5 months ago

On a fresh tutor install, when I try to enable tutor-mfe 17.0.1, I get errors. So I do:

sudo apt update
sudo apt install python3 python3-pip libyaml-dev -y
mkdir -p ~/.venvs
python3 -m venv ~/.venvs/foo
source ~/.venvs/foo/bin/activate
pip3 install "tutor[full]==17.0.0"
tutor dev launch

And then I do:

pip install tutor-mfe==17.0.1
tutor plugins enable mfe

I get

Error applying action: func=<function discover_package..load at 0x7a04f549a200> contexts=['plugins']' Traceback (most recent call last): File "/home/silidrone/.venvs/res4city/bin/tutor", line 8, in sys.exit(main()) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/tutor/commands/cli.py", line 27, in main cli() # pylint: disable=no-value-for-parameter File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, *kwargs) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/tutor/commands/plugins.py", line 142, in enable plugins.load(plugin) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/tutor/plugins/init.py", line 111, in load hooks.Actions.PLUGIN_LOADED.do(name) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/tutor/core/hooks/actions.py", line 116, in do self.do_from_context(None, args, kwargs) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/tutor/core/hooks/actions.py", line 135, in do_from_context callback.do( File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/tutor/core/hooks/actions.py", line 36, in do self.func(*args, **kwargs) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/tutor/plugins/v1.py", line 77, in load entrypoint.load() File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/pkg_resources/init.py", line 2465, in load return self.resolve() File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/pkg_resources/init.py", line 2471, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/home/silidrone/.venvs/res4city/lib/python3.10/site-packages/tutormfe/plugin.py", line 8, in import importlib_resources ModuleNotFoundError: No module named 'importlib_resources'

But when I use tutor-mfe 17.0.0 it works just fine. Isn't 17.0.1 supposed to be compatible with 17.0.0 (or any other 17.x.x version for that matter)? Or is this just a direct bug in 17.0.1?

regisb commented 5 months ago

This issue was fixed in tutor v17.0.2 https://github.com/overhangio/tutor/releases/tag/v17.0.2 In general, you should always run the latest version of the major release you want. In your case, you should run pip install --upgrade 'tutor[full]>=17.0.0,<18.0.0'.

Silidrone commented 5 months ago

Thanks for the advice.