Skip to content
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

find-kedro with src directory - improve error message #14

Open
WaylonWalker opened this issue Oct 12, 2020 · 0 comments
Open

find-kedro with src directory - improve error message #14

WaylonWalker opened this issue Oct 12, 2020 · 0 comments

Comments

@WaylonWalker
Copy link
Owner

When using find-kedro in a project with a src directory the cli throws a really confusing error message. when specifying the directory it works just fine.

find-project on ξ‚  main via 🐍 v3.8.5 via πŸ…’ kedro took 4s 
❯ find-kedro
Traceback (most recent call last):
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2191, in _handle_ns
    loader = importer.find_spec(packageName).loader
  File "<frozen importlib._bootstrap_external>", line 1466, in find_spec
  File "<frozen importlib._bootstrap_external>", line 64, in _path_join
  File "<frozen importlib._bootstrap_external>", line 64, in <listcomp>
AttributeError: 'PosixPath' object has no attribute 'rstrip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/waylon/miniconda3/envs/kedro/bin/find-kedro", line 8, in <module>
    sys.exit(cli())
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/find_kedro/cli.py", line 85, in cli
    pipelines = find_kedro(
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/find_kedro/core.py", line 55, in find_kedro
    modules[key] = _import(nodes_file, directory)
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/find_kedro/core.py", line 250, in _import
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "venv/lib/python3.8/site-packages/tables/nodes/filenode.py", line 41, in <module>
    import tables
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/tables/__init__.py", line 148, in <module>
    from .tests import print_versions, test
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/tables/tests/__init__.py", line 21, in <module>
    from tables.tests.common import print_versions
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/tables/tests/common.py", line 25, in <module>
    from pkg_resources import resource_filename
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3239, in <module>
    def _initialize_master_working_set():
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3222, in _call_aside
    f(*args, **kwargs)
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set
    tuple(
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3265, in <genexpr>
    dist.activate(replace=False)
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2780, in activate
    declare_namespace(pkg)
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2279, in declare_namespace
    _handle_ns(packageName, path_item)
  File "/home/waylon/miniconda3/envs/kedro/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2196, in _handle_ns
    loader = importer.find_module(packageName)
  File "<frozen importlib._bootstrap_external>", line 486, in _find_module_shim
  File "<frozen importlib._bootstrap_external>", line 1421, in find_loader
  File "<frozen importlib._bootstrap_external>", line 1466, in find_spec
  File "<frozen importlib._bootstrap_external>", line 64, in _path_join
  File "<frozen importlib._bootstrap_external>", line 64, in <listcomp>
AttributeError: 'PosixPath' object has no attribute 'rstrip'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant