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

ModuleNotFoundError: No module named 'asdl' #2

Open
talk2kabir opened this issue Aug 11, 2020 · 2 comments
Open

ModuleNotFoundError: No module named 'asdl' #2

talk2kabir opened this issue Aug 11, 2020 · 2 comments

Comments

@talk2kabir
Copy link

Hello,
Please I am trying to preprocess the data to obtain the .bin file that will enable me train the data. Unfortunately, the following error keep appearing.
(base) lab@master:~/external-knowledge-codegen$ python datasets/conala/dataset.py --pretrain data/conala/conala-mined.jsonl --topk 100000 --include_api apidocs/processed/distsmpl/snippet_15k/goldmine_snippet_count100k_topk1_temp2.jsonl
Traceback (most recent call last):
File "datasets/conala/dataset.py", line 9, in
from asdl.hypothesis import *
ModuleNotFoundError: No module named 'asdl'

I tried to install asdl library and the error changed to "ModuleNotFoundError: No module named 'asdl.hypothesis'; 'asdl' is not a package"

I will appreciate any help from you to enable me run the model successfully.
Thank you.

@codewithaliceeee
Copy link

I also encountered this problem, may I ask how you finally solved it? Thanks!

@KevinHuuu
Copy link

KevinHuuu commented Oct 13, 2021

I also encountered this problem, but solved by adding this repo to the PYTHONPATH

First one should uninstall the pip asdl package by doing

pip uninstall asdl

and then add PYTHONPATH (the repo contains local built asdl)

export PYTHONPATH=/home/ubuntu/external-knowledge-codegen:path

but I also get the following error after the above procudure

from file:  data/conala/conala-mined.jsonl
Traceback (most recent call last):
  File "datasets/conala/dataset.py", line 225, in <module>
    out_dir=args.out_dir)
  File "datasets/conala/dataset.py", line 44, in preprocess_conala_dataset
    firstk=num_mined)
  File "datasets/conala/dataset.py", line 118, in preprocess_dataset
    tgt_ast = python_ast_to_asdl_ast(python_ast, transition_system.grammar)
  File "/home/ubuntu/external-knowledge-codegen/asdl/lang/py/py_asdl_helper.py", line 50, in python_ast_to_asdl_ast
    child_node = python_ast_to_asdl_ast(val, grammar)
  File "/home/ubuntu/external-knowledge-codegen/asdl/lang/py/py_asdl_helper.py", line 33, in python_ast_to_asdl_ast
    production = grammar.get_prod_by_ctr_name(py_node_name)
  File "/home/ubuntu/external-knowledge-codegen/asdl/asdl.py", line 49, in get_prod_by_ctr_name
    return self._constructor_production_map[name]
KeyError: 'AnnAssign'

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

3 participants