Description
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
- Create a new Python environment with no libraries installed.
- Install RocketPy using
pip install rocketpy
- 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
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
.