ModuleNotFoundError: No module named 'plotly'

Hi,
I’m exploring the free version of viktor.ai and wanted to incorporate plotly, but no matter what I do I always get the error “ModuleNotFoundError: No module named ‘plotly’”.
How can I solve this?

Thanks, Ana

Hi Ana,

Welcome to this Community Forum! Thank you for posting.

Since plotly is a separate python package, this will need to be explicitly installed along with the VIKTOR package. Please see: VIKTOR docs - Use other Python Packages, for more information on this.

In summary, what you’ll need to do to be able to use any additional python package in your VIKTOR app:

  1. Add the package to the requirements.txt file (I advise you to ‘pin’ the version)
  2. Re-install the app, using viktor-cli install

Please let us know if that solves your problem.

Thank you! It worked :grinning:

same issue here. i cannot install plotly.

ok i see, it works now. i should save the requirements.txt before installing.

Hi, Thanks for posting.

Did you know that it is possible to enable ‘autosave’ in VScode? This makes developing with VIKTOR much more convenient. Since VIKTOR picks up changes in files automatically when the file is saved.

More information can be found here: Basic Editing in Visual Studio Code