TERM environment variable not set. Mac OS os.system("clear")

已回答

Hi, I'm quite the noob. 

I am trying to use the function os.system("clear"). Initially, I got the following error:

"TERM environment variable not set."

I followed the instructions, given by various sources, that describe how to set the TERM as defined here:

http://softwaretester.info/pycharm-term-environment-variable-not-set/

I no longer get the error but the console does not clear. I do not have this issue when from the terminal using the "python interactive session" (I think this is what it's called when "python" or "python3" is typed in the terminal). The issue persists though in PyCharm. I saw a few unanswered cases of this:

https://teamtreehouse.com/community/term-environment-variable-not-set-pycharm 

Thanks in advance

2

Hi Claudio! Could you please enable Emulate terminal in output console option for this run configuration? Has it helped?

10
Avatar
Permanently deleted user

Thank you!!

0
Avatar
Permanently deleted user

works for me.

✔️ Emulate terminal in output console 

 

0
Avatar
Permanently deleted user

So much valuable information! Thank you so much!

0
Avatar
Permanently deleted user

Thank you VERY much!!!

nice solution

0
Avatar
Permanently deleted user

Great !!! It workesss

0

请先登录再写评论。