I started getting this error quite a while ago in pycharm only. Cant quite pinpoint what else may have caused it. I for the most part just continued to work around it. Before the error started coming up it worked perfectly. What brings it up is my clear_screen function. It works fine if I just run the file in terminal and it also runs good in VS Code but only in Pycharm does this error pop up. And for reference I am running Linux Mint. Heres the clear screen code.
Python:
import os
def clear_screen():
if os.name == 'nt':
os.system('cls') # For Windows
else:
os.system('clear') # For other platforms like macOS and Linux