sudouser2010/flask_optional_routes

ModuleNotFoundError: No module named 'flask_optional_routes.optional_routes'

Closed this issue · 3 comments

Traceback (most recent call last): File "/opt/pycharm/helpers/pydev/pydevd.py", line 1664, in <module> main() File "/opt/pycharm/helpers/pydev/pydevd.py", line 1658, in main globals = debugger.run(setup['file'], None, None, is_module) File "/opt/pycharm/helpers/pydev/pydevd.py", line 1085, in run runpy._run_module_as_main(module_name, alter_argv=False) File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/flask/__main__.py", line 15, in <module> main(as_module=True) File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/flask/cli.py", line 513, in main cli.main(args=args, prog_name=name) File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/flask/cli.py", line 380, in main return AppGroup.main(self, *args, **kwargs) File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/click/decorators.py", line 64, in new_func return ctx.invoke(f, obj, *args, **kwargs) File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/flask/cli.py", line 423, in run_command app = DispatchingApp(info.load_app, use_eager_loading=eager_loading) File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/flask/cli.py", line 152, in __init__ self._load_unlocked() File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/flask/cli.py", line 176, in _load_unlocked self._app = rv = self.loader() File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/flask/cli.py", line 237, in load_app rv = locate_app(self.app_import_path) File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/flask/cli.py", line 90, in locate_app __import__(module) File "/home/lherrera/apps/untitled/app.py", line 4, in <module> from flask_optional_routes import OptionalRoutes File "/home/lherrera/apps/untitled/env/lib/python3.6/site-packages/flask_optional_routes/__init__.py", line 1, in <module> from .optional_routes import * ModuleNotFoundError: No module named 'flask_optional_routes.optional_routes'

I believe this is because the actual files required are not setup when you run pip install:

/opt/customer-portal/venv/lib/python3.6/site-packages/flask_optional_routes

[root@localhost flask_optional_routes]# ls
example.py init.py pycache

You would expect this folder and it content in that directory as well: https://github.com/sudouser2010/flask_optional_routes/tree/master/optional_routes

@leherreras thank you for your feedback.
And my apologies for the late response.
I'll take a look at the issue and fix it later this month.

Heads up @leherreras @loopodoopo, the pip install issue has been fixed in version 1.4.1.
I'm marking this issue as resolved.