Environment variable 'USER' is not defined


#1

Hello,I use pip install NuPIC and NuPIC.core successfully, but when i try to run the examples in NuPIC source code, then i always get a problem as follows:
" variable %r, which is not defined" % (varname))
RuntimeError: Attempting to use the value of the environment variable ‘USER’, which is not defined
who can tell me what should i do? thank you!


Help with a basic python error
#2

You should research how to set an environment variable on your OS and set ‘USER’ to the your username you use to log into the OS.


#3

Thank you! i tried that, but it does not help, and i wander if it is the problem about that when i use the install command without using --user


#4

I solved the problem, thank you very much @rhyolight


#5

How did you solve the problem?


#6

I did that follow rhyolight tells me that set ‘USER’ to the your username you use to log into the OS.
it does not work as i didn’t restart my computer after i set the environment variable 'USER’
so,after i restart my computer, i solved this problem.
thanks rhyolight again.


#7

In case useful for anyone else…

Im running nupic in a pipenv and so ran into this problem too.

I managed to work around it by setting the USER variable in a .env file in same folder as my Pipfile