It can, because the setup software needs to talk to the printer over Wi-Fi, even if your computer is usually wired.
Here's what you do: While you're running the HP Smart setup, turn on your computer's Wi-Fi. You don't need to unplug the Ethernet cable. The setup software will use the Wi-Fi connection to find the printer on your network.
If that didn't work: First, make sure the printer is in setup mode—the blue Wi-Fi light should be blinking. If it's not, you'll need to restart that mode. Swipe down on the printer's screen, go to Network Setup, and choose Restore Network Settings. Wait a minute and try again.
Heads up: If you use a VPN for work, disconnect from it before installing HP Smart. You can reconnect after the printer is set up.