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

Answered

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

6 comments
Comment actions Permalink

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

3
Comment actions Permalink

works for me.

✔️ Emulate terminal in output console 

 

0
Comment actions Permalink

So much valuable information! Thank you so much!

0
Comment actions Permalink

Thank you VERY much!!!

nice solution

0
Comment actions Permalink

Great !!! It workesss

0

Please sign in to leave a comment.