Plotly not install errror, though installed
See original GitHub issueHi All,
I have Plotly installed and I am getting an error from optuna that it isn’t. My version of plotly is 4.8.1. Is there a solution for this? If I should install an older version of plotly, which version should it be?
Thanks! Chris
ImportError Traceback (most recent call last) <ipython-input-308-04cb7fde5fca> in <module> ----> 1 optuna.visualization.plot_intermediate_values(study)
~\Anaconda3\lib\site-packages\optuna\visualization\intermediate_values.py in plot_intermediate_values(study) 68 “”" 69 —> 70 _check_plotly_availability() 71 return _get_intermediate_plot(study) 72
~\Anaconda3\lib\site-packages\optuna\visualization\utils.py in _check_plotly_availability()
38 "Plotly can be installed by executing $ pip install plotly
. "
39 "For further information, please refer to the installation guide of plotly. "
—> 40 "(The actual import error is as follows: " + str(plotly_imports._import_error) + “)”
41 )
42
ImportError: Plotly is not available. Please install plotly to use this feature. Plotly can be installed by executing $ pip install plotly
. For further information, please refer to the installation guide of plotly. (The actual import error is as follows: No module named ‘plotly’)
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (4 by maintainers)
Top GitHub Comments
encounter the same issue in Ubuntu my OS is Ubuntu 20.04.3, python 3.8.10, plotly 5.3.1, optuna 2.9.1 when i am gonna use plot_optimization_history(study) ( i have installed plotly by pip install and i confirm two of these packages are at same location and i have imported plt before.
but it also reminded me that i need to install plotly to use this feature
i just dont know how to deal with it
here is my error report:
ModuleNotFoundError Traceback (most recent call last) /usr/local/lib/python3.8/dist-packages/optuna/visualization/_plotly_imports.py in <module> 6 with try_import() as _imports: # NOQA ----> 7 import plotly # NOQA 8 from plotly import version as plotly_version
ModuleNotFoundError: No module named ‘plotly’
The above exception was the direct cause of the following exception:
ImportError Traceback (most recent call last) <ipython-input-72-db7ed42732c3> in <module> ----> 1 plot_intermediate_values(study)
/usr/local/lib/python3.8/dist-packages/optuna/visualization/_intermediate_values.py in plot_intermediate_values(study) 64 “”" 65 —> 66 _imports.check() 67 return _get_intermediate_plot(study) 68
/usr/local/lib/python3.8/dist-packages/optuna/_imports.py in check(self) 84 if self._deferred is not None: 85 exc_value, message = self._deferred —> 86 raise ImportError(message) from exc_value 87 88
ImportError: Tried to import ‘plotly’ but failed. Please make sure that the package is installed correctly to use this feature. Actual error: No module named ‘plotly’.
I had the same issue on MacOS. It resolved itself when I started a new notebook without matlotlib. I think there might be some conflict between those two libs.