-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
couldn't open import "*.libsonnet": no match locally or in the Jsonnet library paths. #122
Comments
Yes. This is so that relative paths found inside configs work as expected.
The idea of giving
It is |
- Fixed jsonnet import path not working correctly #122.
This is fixed in commit f08329c. |
Yes, I can confirm Thx you for your quick fix, feel free to close it when released. ;) |
This is now part of v4.3.0 which has just been released. |
Issue
Due to the extensive functionality of jsonnet (as mentioned in #117 (comment)), I tried switching the default configuration to jsonnet format, but I ran into problems with import.
Step to reproduce
Here is the minimal config to reproduce:
my directory structure:
test.py
:conf/name.libsonnet
:conf/test.jsonnet
:If I run
python test.py --config conf/test.jsonnet
, I got the following error:Click to expand
Discovery
And I also find
evaluate_snippet(filename, expr)
usefilename
to detect locally directory:It seems like
jsonargparse
somehow change current working directory which can be verify throughprint(os.getcwd())
which make
cfg_str = _jsonnet.evaluate_snippet(cfg_path, cfg_str, ext_vars=ext_vars, ext_codes=ext_codes)
failedbut
cfg_str = _jsonnet.evaluate_snippet("", cfg_str, ext_vars=ext_vars, ext_codes=ext_codes)
works.BTW, why not use
evaluate_file(filename)
directly butevaluate_snippet(filename, expr)
. They both acceptext_vars
andext_codes
The text was updated successfully, but these errors were encountered: