Skip to content

ModuleNotFoundError: No module named 'ipywidgets' #251

Closed
@giovaniceotto

Description

@giovaniceotto

Describe the bug

Installing and running RocketPy on a fresh new Python environment may result in the following error when trying to load RocketPy classes, specially the EnvironmentAnalysis class:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In [1], line 1
----> 1 from rocketpy import Environment, SolidMotor, Rocket, Flight, Function, utilities

File /workspaces/RocketPy/rocketpy/__init__.py:25
     22 __status__ = "Production"
     24 from .Environment import Environment
---> 25 from .EnvironmentAnalysis import EnvironmentAnalysis
     26 from .Flight import Flight
     27 from .Function import Function

File /workspaces/RocketPy/rocketpy/EnvironmentAnalysis.py:11
      8 import warnings
      9 from collections import defaultdict
---> 11 import ipywidgets as widgets
     12 import matplotlib.ticker as mtick
     13 import netCDF4

ModuleNotFoundError: No module named 'ipywidgets'

To Reproduce

  1. Create a new Python environment with no libraries installed.
  2. Install RocketPy using pip install rocketpy
  3. Run python and import rocketpy using, for example, from rocketpy import *.

Expected behavior

No errors! All required libraries should be installed during the installation of RocketPy.

Screenshots

image

Additional context

It seems that ipywidgets is a requirement for the EnvironmentAnalysis class. It appears in requirements.txt but does not appear in setup.py, which is the first place it should appear. Adding it to setup.py and making sure all requirements are synced across the two files should fix the problem.

I do not believe this bug fix warrants a new version since it can be easily fixed by the user by running pip install ipywidgets.

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingGood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions