question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plotly not install errror, though installed

See original GitHub issue

Hi 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:closed
  • Created 3 years ago
  • Comments:21 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Hurricane-kcommented, Sep 1, 2021

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’.

1reaction
pallogucommented, Mar 9, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix: No module named plotly - Statology
Step 1: pip install plotly. Since Plotly doesn't come installed automatically with Python, you'll need to install it yourself.
Read more >
Module Not Found Error for plotly - Plotly Python
Hi guys, I am getting Module not found error even though i install plotly and one more thing same thing happen with cufflinks....
Read more >
python - Error when trying to install plotly - Stack Overflow
Since you're on a Mac, running pip will install a package into the Mac's own copy of Python 2.7. You're then running Python,...
Read more >
How to fix plotly Module Not Found Error - YouTube
Hello there. in this video, we go ahead and fix the plotly module not found error in Jupyter notebook.Interested in learning the basics...
Read more >
ModuleNotFoundError: No module named plotly, simple fix!
Upgrade or install plotly package via Conda or Pip. The most common reason for this error is that the plotly package is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found