trape icon indicating copy to clipboard operation
trape copied to clipboard

NameError: name 'os' is not defined

Open bphd opened this issue 4 years ago • 5 comments

File "trape.py", line 56, in utils.Go(utils.Color['whiteBold'] + "WELCOME " + utils.Color['greenBold'] + os.uname()[1].upper() + utils.Color['whiteBold'] + " TO TRAPE" + utils.Color['white']) NameError: name 'os' is not defined

bphd avatar Nov 21 '19 09:11 bphd

+1

GrbavaCigla avatar Jan 25 '20 21:01 GrbavaCigla

+1

chandanroksjsr avatar Feb 20 '20 14:02 chandanroksjsr

@bphd Have you tried running pip install -r requirements.txt The name 'os' not being defined is because it has not been imported correctly. If you look at the file, you will see that it is in a try block. My guess is that you do not have one or both of the other modules installed. Running the pip install command should remedy that.

flyphisherman avatar Mar 25 '20 05:03 flyphisherman

Sometimes it depends which version of python you have and which default is. try to specify pip2 install -r requirements.txt and should work

psychomad avatar Apr 13 '20 18:04 psychomad

no it doesn't work. i use pip install -r requirements.txt as recommended and having the same problem in python 2.7. in python, os is the standard library, isn't it? It's never been a distribution that we have to manually download. that just silly

abdullzz avatar Jan 10 '21 16:01 abdullzz