WP-CLI media import error

I figured it out, with some help. You have to be on the same server where the files are located to use wp media import. The steps are:

  1. Log out of ssh connection
  2. Log into the remote server using sftp
  3. Upload the files using sftp, then log out
  4. Log back in using ssh
  5. Then you can use wp media import

Essentially, ssh is for commands and sftp is for file transfers.

I hope this helps someone else with this issue.