Welcome to the Treehouse Community
Looking to learn something new?
Ivan Monge3,327 Points
TERM environment variable not set. Pycharm
So I am trying to run this code in my IDE. And yeah it runs fine for the letter refined code game. But I am getting this message in the console. "TERM environment variable not set." in every line it prints out. I am currently running Pycharm in my Mac computer. I know it has to do with this but still I don't understand.
def clear(): if os.name == 'nt': os.system('cls') else: os.system('clear')
Shane ConroyCourses Plus Student 11,032 Points
Shana has the right answer, but I'll clarify how to add the right variable:
- If you haven't already, right click on the file you want to run, and click 'Run' (this will create a 'Run Configuration')
- Go to Run > Edit Configurations
- Next to the 'Environment Variables' field, click on the '...'
- Click the '+'
- On the right hand side of the new entry that's created after clicking '+', put 'TERM'
- On the left, put 'xterm-color'
- Click 'ok'.
Now when you run the script, there should be no error.
That's an environment variable that your Mac's terminal application would use. Have a look at this question on Stack Overflow:
Add this to your profile:
Shana HT3,292 Points
In the menu
Run > Edit Configurations
This brings up a new window, this is where you add the Environmental Variables
iulian borza4,294 Points
I've tried adding the TERM variable to PyCharm and Eclipse with Python interpreter 2.7 and 3.5. It doesn't work for me. I'm using OSX. I've also export it in my terminal. I'm still getting the same error. Do you guys have other ideas?