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

error running example #9

Closed
stas-g opened this issue Nov 1, 2021 · 5 comments
Closed

error running example #9

stas-g opened this issue Nov 1, 2021 · 5 comments

Comments

@stas-g
Copy link

stas-g commented Nov 1, 2021

hi,

i have the following error when running an example provided with the potassco suite:

nfg@NI-CA-107962:~/clingo_guide/examples$ asprin base.lp preference2.lp
asprin version 3.1.1
Reading from base.lp ...
*** ERROR: (asprin): 'Control' object has no attribute 'builder'
UNKNOWN

i am running clingo version 5.5.0 on ubuntu (WLS2).

any help would be appreciated.
thank you,
stasia

@javier-romero
Copy link
Collaborator

Hi Stasia, asprin works with version 5.4 of clingo, not with the latest 5.5 version. If you install it with conda in a new environment, it should already install the right version of clingo.

@stas-g
Copy link
Author

stas-g commented Nov 1, 2021

dear Javier,

thank you for your quick reply. unfortunately, even after following your advice, the error persists:

(asprin_env) nfg@NI-CA-107962:~/clingo_guide/examples$ conda list
# packages in environment at /home/nfg/anaconda3/envs/asprin_env:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
asprin                    3.1.1                      py_1    potassco
ca-certificates           2021.10.8            ha878542_0    conda-forge
cffi                      1.15.0                   pypi_0    pypi
clingo                    5.4.0            py39h3fd9d12_1    potassco
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
libffi                    3.4.2                h9c3ff4c_4    conda-forge
libgcc-ng                 11.2.0              h1d223b6_11    conda-forge
libgomp                   11.2.0              h1d223b6_11    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_11    conda-forge
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
openssl                   3.0.0                h7f98852_1    conda-forge
pip                       21.3.1             pyhd8ed1ab_0    conda-forge
pycparser                 2.20                     pypi_0    pypi
python                    3.9.7           hf930737_3_cpython    conda-forge
python_abi                3.9                      2_cp39    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
setuptools                58.3.0           py39hf3d152e_0    conda-forge
sqlite                    3.36.0               h9cd32fc_2    conda-forge
tk                        8.6.11               h27826a3_1    conda-forge
tzdata                    2021e                he74cb21_0    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h36c2ea0_1013    conda-forge
(asprin_env) nfg@NI-CA-107962:~/clingo_guide/examples$ asprin base.lp preference2.lp
asprin version 3.1.1
Reading from base.lp ...
*** ERROR: (asprin): 'Control' object has no attribute 'builder'
UNKNOWN

additionally, it was complaining:
AttributeError: module 'clingo' has no attribute 'ast'
which i fixed by including a line importing ast in the asprin executable...

best,
stas

@javier-romero
Copy link
Collaborator

Hi, I am not sure about why is it happening.
Are you sure that the system is using the right version of clingo?
Sometimes one has to write export PYTHONPATH= to have a clean setting.

And maybe also try with a new clean environment,
although I guess you have already tried this:
conda create -n other_asprin -c potassco asprin

@rkaminsk
Copy link
Member

rkaminsk commented Nov 2, 2021

My guess is that the clingo 5.5 module is still imported from somewhere. You can inspect which modules are included from where by passing the -v option to python.

@stas-g
Copy link
Author

stas-g commented Nov 3, 2021

yes, @rkaminsk Roland, you are quite right --- python is still using clingo 5.5:

(asprin_env) nfg@NI-CA-107962:~/clingo_guide/examples$ pip freeze
asprin==3.1.1
cffi==1.15.0
clingo==5.5.0.post3
pycparser==2.20
(asprin_env) nfg@NI-CA-107962:~/clingo_guide/examples$ clingo
clingo version 5.4.0
Reading from stdin

i uninstalled clingo via: pip uninstall clingo so now pip freeze doesn't show it but i can still load it from within python (!) and my initial code of asprin base.lp preference2.lp works. thanks you for your help both!

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