The following code takes in path to an image, removes the background, and saves it to desktop under a name the user decides:
from rembg import remove
from PIL import Image
input_path = input("Please Drag & Drop an image:") # Takes image path
output_name = input("Give it a name:")
output_path = rf'C:\Users\user\Desktop\{output_name}.png'
input_image = Image.open(input_path)
output = remove(input_image)
output.save(output_path)
It works fine when I run it in PyCharm. I copy the image file, the code executes flawlessly and the output is seen in the desktop. But when I run the code through CMD terminal, it asks for image, and I drag the image to the terminal and it copies the path and everything works well, but when I press enter to begin I get this error and I cannot figure out what is the issue:
Does anyone know what the issue is?