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

Confusing error message when conda-lock fails to parse meta.yaml #81

Open
arthurp opened this issue Mar 5, 2021 · 2 comments
Open

Confusing error message when conda-lock fails to parse meta.yaml #81

arthurp opened this issue Mar 5, 2021 · 2 comments

Comments

@arthurp
Copy link

arthurp commented Mar 5, 2021

I'm pretty sure my meta.yaml is too complex for conda-lock to process. I'm fine with this. However, the error message is very confusing because it comes from inside jinja2:

$ conda-lock lock -p linux-64  -f conda_recipe/meta.yaml 
[...]
TypeError: no loader for this environment specified
Full error message
$ conda-lock lock -p linux-64  -f conda_recipe/meta.yaml 
generating lockfile for linux-64
Traceback (most recent call last):
  File "/home/amp/LocalInstalls/conda/miniconda3/envs/katana-dev/bin/conda-lock", line 10, in <module>
    sys.exit(main())
  File "/home/amp/LocalInstalls/conda/miniconda3/envs/katana-dev/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/amp/LocalInstalls/conda/miniconda3/envs/katana-dev/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/amp/LocalInstalls/conda/miniconda3/envs/katana-dev/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/amp/LocalInstalls/conda/miniconda3/envs/katana-dev/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/amp/LocalInstalls/conda/miniconda3/envs/katana-dev/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/amp/LocalInstalls/conda/miniconda3/envs/katana-dev/lib/python3.8/site-packages/conda_lock/conda_lock.py", line 598, in lock
    run_lock(
  File "/home/amp/LocalInstalls/conda/miniconda3/envs/katana-dev/lib/python3.8/site-packages/conda_lock/conda_lock.py", line 504, in run_lock
    make_lock_files(
  File "/home/amp/LocalInstalls/conda/miniconda3/envs/katana-dev/lib/python3.8/site-packages/conda_lock/conda_lock.py", line 274, in make_lock_files
    lock_specs = parse_source_files(
  File "/home/amp/LocalInstalls/conda/miniconda3/envs/katana-dev/lib/python3.8/site-packages/conda_lock/conda_lock.py", line 420, in parse_source_files
    parse_meta_yaml_file(src_file, platform, include_dev_dependencies)
  File "/home/amp/LocalInstalls/conda/miniconda3/envs/katana-dev/lib/python3.8/site-packages/conda_lock/src_parser/meta_yaml.py", line 99, in parse_meta_yaml_file
    rendered = t.render()
  File "/home/amp/.local/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/home/amp/.local/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/home/amp/.local/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in top-level template code
TypeError: no loader for this environment specified

The meta.yaml file involved is: https://github.com/KatanaGraph/katana/blob/9a63b012a09b5261ec5b12b06c51f3f576713df4/conda_recipe/meta.yaml

The error is the same with conda-lock versions (the message above is from 0.8.0):

  • conda-lock 0.8.0 pyhd8ed1ab_0 conda-forge
  • conda-lock 0.8.1.dev2+g2702768 pypi_0 pypi (installed with pip install .)
@mariusvniekerk
Copy link
Collaborator

yeah the meta.yaml support only really works for very simple conda recipes without lots of fancy templates. For your case you are probably better off locking from an environment.yaml

@arthurp
Copy link
Author

arthurp commented Mar 16, 2021

Definitely. :-) Hence the issue being about the error, not the failure itself.

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

2 participants