You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update of bayesian-optimization module breaks bayesan extension #409
Yesterday release of bayesian-optimization module version 2.0.0 broke the bayesian module of PyMoDAQ because the UtilityFunction class was replaced by AcquisitionFunction.
Running dashboard with bayesian-optimization=2.0.0 raise the following error:
Traceback (most recent call last):
File "/home/louisld/Documents/PyMoDAQ/env/bin/dashboard", line 5, in <module>
from pymodaq.dashboard import main
File "/home/louisld/Documents/PyMoDAQ/env/lib/python3.11/site-packages/pymodaq/dashboard.py", line 28, in <module>
from pymodaq.utils.managers.preset_manager import PresetManager
File "/home/louisld/Documents/PyMoDAQ/env/lib/python3.11/site-packages/pymodaq/utils/managers/preset_manager.py", line 1, in <module>
from pymodaq.extensions import get_models
File "/home/louisld/Documents/PyMoDAQ/env/lib/python3.11/site-packages/pymodaq/extensions/__init__.py", line 16, in <module>
from .bayesian.bayesian_optimisation import BayesianOptimisation
File "/home/louisld/Documents/PyMoDAQ/env/lib/python3.11/site-packages/pymodaq/extensions/bayesian/__init__.py", line 1, in <module>
from . import bayesian_optimisation
File "/home/louisld/Documents/PyMoDAQ/env/lib/python3.11/site-packages/pymodaq/extensions/bayesian/bayesian_optimisation.py", line 13, in <module>
from pymodaq.extensions.bayesian.utils import (get_bayesian_models, BayesianModelGeneric,
File "/home/louisld/Documents/PyMoDAQ/env/lib/python3.11/site-packages/pymodaq/extensions/bayesian/utils.py", line 19, in <module>
from bayes_opt import UtilityFunction
ImportError: cannot import name 'UtilityFunction' from 'bayes_opt' (/home/louisld/Documents/PyMoDAQ/env/lib/python3.11/site-packages/bayes_opt/__init__.py)
An easy workaround is to install version 1.5.1 of the library : pip install bayesian-optimization==1.5.1.
I ran into that today as well. On a fresh installation of pymodaq (4.4.6), the dashboard won't start. The solution to manually install bayesian-optimization version 1.5.1 still solves the problem.
Activity
restrict bayesian optimisation package see issue #409
restrict bayesian optimisation package see issue #409
seb5g commentedon Oct 22, 2024
I applied the workaround by restricting the version of Bayesian Optimisation package. Will have to work to make it compatible again in its new major!
loicguilmard commentedon Nov 6, 2024
i encoutered this issue. May be i didn't generate my env the right way.
Where did you add this requierement ?
seb5g commentedon Nov 6, 2024
i modified only v5. I'm doing it for v4 right away
bernhardlang commentedon Nov 12, 2024
I ran into that today as well. On a fresh installation of pymodaq (4.4.6), the dashboard won't start. The solution to manually install bayesian-optimization version 1.5.1 still solves the problem.
seb5g commentedon Nov 12, 2024
it seems the last two released were not published on pypi hence the issue you ran into...
seb5g commentedon Nov 12, 2024
I manually triggered the release of version 4.4.7 on pypi. Could you check if it is ok now?
loicguilmard commentedon Nov 12, 2024
prompt# conda create -n pymodaq447test_baye python=3.11
prompt# conda activate pymodaq447test_baye
prompt# pip install pyqt5 pymodaq==4.4.7
...
Collecting bayesian-optimization<2.0.0 (from pymodaq==4.4.7)
Using cached bayesian_optimization-1.5.1-py3-none-any.whl.metadata (16 kB)
...
prompt# dashboard
OK !