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

AttributeError: module 'clingo' has no attribute 'Control' #28

Open
jpsiegel opened this issue Mar 4, 2021 · 4 comments
Open

AttributeError: module 'clingo' has no attribute 'Control' #28

jpsiegel opened this issue Mar 4, 2021 · 4 comments
Assignees
Labels

Comments

@jpsiegel
Copy link

jpsiegel commented Mar 4, 2021

Hello, I tried running your example use for clyngor and it raised this error. Its weird since if I try to use clingo python API example it also raises an error for clingo.Control()
Any ideas? Im really looking forward to use clyngor in a production enviroment

@jpsiegel jpsiegel closed this as completed Mar 6, 2021
@Aluriak
Copy link
Owner

Aluriak commented Mar 8, 2021

Hello !
I do not know why you closed that issue, nor what is the error you found.

Can you provide the exact source code you used ?

@Aluriak Aluriak self-assigned this Mar 8, 2021
@Aluriak Aluriak added the bug label Mar 8, 2021
@Aluriak Aluriak reopened this Mar 8, 2021
@Derfies
Copy link

Derfies commented Mar 17, 2021

Hi @Aluriak, I've just run into the same issue. Ran pipenv install clyngor to add the package to a venv, then ran the first sample on pypi page, ie:

from clyngor import ASP, solve

answers = ASP("""
rel(a,(c;d)). rel(b,(d;e)).
obj(X):- rel(X,_) ; rel(X,Y): att(Y).
att(Y):- rel(_,Y) ; rel(X,Y): obj(X).
:- not obj(X):obj(X).
:- not att(Y):att(Y).
""")
for answer in answers:
    print(answer)

full traceback is:

"C:\Users\Jamie Davies\.virtualenvs\reactor-iED7jNFQ\Scripts\python.exe" test_clingo.py
Traceback (most recent call last):
  File "test_clingo.py", line 4, in <module>
    answers = ASP("""
  File "C:\Users\Jamie Davies\.virtualenvs\reactor-iED7jNFQ\lib\site-packages\clyngor\inline.py", line 17, in ASP
    return solve(inline=source_code, stats=False, **kwargs)
  File "C:\Users\Jamie Davies\.virtualenvs\reactor-iED7jNFQ\lib\site-packages\clyngor\solving.py", line 98, in solve
    ctl = clyngor.clingo_module.Control(options)
AttributeError: module 'clingo' has no attribute 'Control'

Process finished with exit code 1

@Derfies
Copy link

Derfies commented Mar 17, 2021

Adding use_clingo_module=False and setting clingo_bin_path seems to work when using my own binaries.

@Aluriak
Copy link
Owner

Aluriak commented Mar 22, 2021

Thank you for your feedback !

Oh, yes. By default, clingo module is used if available. That behavior is however quite unexpected. I should change that.

Thanks for pointing this out. You should use use_clingo_module=False everywhere from now, unless you want to use the python clingo module compiled along clingo when building clingo from sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants