Skip to content

Conda package built off master branch fails with ModuleNotFoundError: No module named 'tenacity' #4129

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

Closed
LiamConnors opened this issue Mar 28, 2023 · 1 comment

Comments

@LiamConnors
Copy link
Member

While working on #4128
I noted that creating a figure object in a notebook failed when using the Conda build

Steps to recreate.

  1. In a new Conda environment install the Conda build
  2. Open a jupyter lab notebook
  3. Run the following in a cell:
import plotly.graph_objects as go
go.Figure()

Fails with this error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
File ~/opt/anaconda3/envs/test514/lib/python3.10/site-packages/IPython/core/formatters.py:342, in BaseFormatter.__call__(self, obj)
    340     method = get_real_method(obj, self.print_method)
    341     if method is not None:
--> 342         return method()
    343     return None
    344 else:

File ~/opt/anaconda3/envs/test514/lib/python3.10/site-packages/plotly/basedatatypes.py:808, in BaseFigure._repr_html_(self)
    804 def _repr_html_(self):
    805     """
    806     Customize html representation
    807     """
--> 808     bundle = self._repr_mimebundle_()
    809     if "text/html" in bundle:
    810         return bundle["text/html"]

File ~/opt/anaconda3/envs/test514/lib/python3.10/site-packages/plotly/basedatatypes.py:820, in BaseFigure._repr_mimebundle_(self, include, exclude, validate, **kwargs)
    815 """
    816 Return mimebundle corresponding to default renderer.
    817 """
    818 import plotly.io as pio
--> 820 renderer_str = pio.renderers.default
    821 renderers = pio._renderers.renderers
    822 from plotly.io._utils import validate_coerce_fig_to_dict

File ~/opt/anaconda3/envs/test514/lib/python3.10/site-packages/_plotly_utils/importers.py:36, in relative_import.<locals>.__getattr__(import_name)
     34     rel_module = ".".join(rel_path_parts[:-1])
     35     class_name = import_name
---> 36     class_module = importlib.import_module(rel_module, parent_name)
     37     return getattr(class_module, class_name)
     39 raise AttributeError(
     40     "module {__name__!r} has no attribute {name!r}".format(
     41         name=import_name, __name__=parent_name
     42     )
     43 )

File ~/opt/anaconda3/envs/test514/lib/python3.10/importlib/__init__.py:126, in import_module(name, package)
    124             break
    125         level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)

File <frozen importlib._bootstrap>:1050, in _gcd_import(name, package, level)

File <frozen importlib._bootstrap>:1027, in _find_and_load(name, import_)

File <frozen importlib._bootstrap>:1006, in _find_and_load_unlocked(name, import_)

File <frozen importlib._bootstrap>:688, in _load_unlocked(spec)

File <frozen importlib._bootstrap_external>:883, in exec_module(self, module)

File <frozen importlib._bootstrap>:241, in _call_with_frames_removed(f, *args, **kwds)

File ~/opt/anaconda3/envs/test514/lib/python3.10/site-packages/plotly/io/_renderers.py:11
      7 from packaging.version import Version
      9 from plotly import optional_imports
---> 11 from plotly.io._base_renderers import (
     12     MimetypeRenderer,
     13     ExternalRenderer,
     14     PlotlyRenderer,
     15     NotebookRenderer,
     16     KaggleRenderer,
     17     AzureRenderer,
     18     ColabRenderer,
     19     JsonRenderer,
     20     PngRenderer,
     21     JpegRenderer,
     22     SvgRenderer,
     23     PdfRenderer,
     24     BrowserRenderer,
     25     IFrameRenderer,
     26     SphinxGalleryHtmlRenderer,
     27     SphinxGalleryOrcaRenderer,
     28     CoCalcRenderer,
     29     DatabricksRenderer,
     30 )
     31 from plotly.io._utils import validate_coerce_fig_to_dict
     33 ipython = optional_imports.get_module("IPython")

File ~/opt/anaconda3/envs/test514/lib/python3.10/site-packages/plotly/io/_base_renderers.py:11
      9 from plotly import utils, optional_imports
     10 from plotly.io import to_json, to_image, write_image, write_html
---> 11 from plotly.io._orca import ensure_server
     12 from plotly.io._utils import plotly_cdn_url
     13 from plotly.offline.offline import _get_jconfig, get_plotlyjs

File ~/opt/anaconda3/envs/test514/lib/python3.10/site-packages/plotly/io/_orca.py:15
     12 from contextlib import contextmanager
     13 from pathlib import Path
---> 15 import tenacity
     17 import _plotly_utils.utils
     18 import plotly

ModuleNotFoundError: No module named 'tenacity'
@LiamConnors
Copy link
Member Author

Was just an issue with how I was installing it

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

1 participant