this specific command does not work on my MacOS either. Why do you need to have the version pinned so specifically? Could you provide us with more details about where you are in the book and what exactly you are trying to do? Did you try your example without pinning the versions and only with the absolutely necessary packages?
I also try to keep this article up to date about KNIME and python in general with additional links for further reference:
It can be a little confusing at first but I would recommend to invest a few maybe hours to grasp the concept of using miniconda or miniforge and conda environments with yaml files and versions. It will greatly enhance your knowledge about how to use python and interact with KNIME. Sometimes the books will struggle somewhat to keep track with all versions and dependencies the latest conda might help.
use conda and only conda-forge channel via miniforge or miniconda
find the latest KNIME recommended yaml file with a minimum of version restrictions
let conda handle all additions and version restrictions and possible updates
tell KNIME where to find your python-environment for deep learning
destill that into a conda environment propagation node to share and have easy access
if you encounter version problems start with only a few restrictions and keep adding and editing them (like @steffen_KNIME has suggested). Check if a KNIME sample workflow would still run
Ok you probably got more than you were bargaining for .
I plan on writing some more about this with examples and screenshots.