Your IPython probably uses Python 2. foo, *bar = ...
only works in Python 3. You can have a look at sys.version_info.major
to check which Python version you are using.
Tee solution is to install IPython for Python 3. Since I don't know which distribution you use the easiest way might be creating a Python 3 venv and installing ipython in there using pip install ipython
.