Help with a basic python error

Sure @way-sal no problem. If you’d like to show the code producing that error maybe I can help (I’m not sure where -15 should come in as a parameter). Though if its a windows vs linux issue I’ll have to defer

this the code of @learner : https://github.com/psdyer/NuPIC-Algorithm-API-Example/blob/master/algorithm_api_example.ipynb

I notice that he comments before the cell containing that code:

For an extra treat, you can use the code below (on Linux) to make GIFs for the first N records of data.

You said you’re on Windows right, so maybe that part won’t work. The block on code seems to produce GIF’s, which is cool and likely work doing though not necessary to getting the algorithms running.

1 Like

oops yes, that’s part of code run on Linux and is not necessary so I delete

the same error ::

That specific RuntimeError is saying that it is missing an environment variable called ‘USER’. You might try setting it to some value to see if you can get any further:

SET USER=dell

(I don’t really use Windows much myself, so this may not be very helpful)

no is not working :frowning:

Do you get the same error about the environment variable ‘USER’ not being defined, or some different error?

If it is the same error, then someone more familiar with Windows will have to help. I saw a similar error about missing environment variable ‘USER’ when installing NuPIC from source in Docker, but in my case it was resolved after setting the environment variable.

thanks @learner is very helpful , but what version of nupic do you use ? because i have a problem of modules , maybe my version of nupic can’t read some under moduls

any idea ???

Given the error, it looks like you need to define the USER environment variable. What is the code inside C:\Users\dell\Desktop\tests\moduls.py?

its your code :https://github.com/psdyer/NuPIC-Algorithm-API-Example/blob/master/algorithm_api_example.ipynb
and the other one is taken from :http://nupic.docs.numenta.org/1.0.5/quick-start/algorithms.html
pffff the same problemin configuration_base.py

Try running these two lines of code from a fresh command line.

>> from nupic.algorithms.sdr_classifier_factory import SDRClassifierFactory
>> classifier = SDRClassifierFactory.create(steps=[1], alpha=0.01)

If you get an error there, then there’s something wrong with your setup.

1 Like

yes the same problem

I’m at a loss then. I’ve only ever run NuPIC on Linux and Mac, and since this looks like a setup issue, I’m guessing something special has to be done in Windows. I suggest reading through the forum for NuPIC+Windows topics and see if there’s something you’re missing.

I don’t want to break your system, but as a hack you could try setting the USER variable to something/anything. I’m sure a quick google will show you how to do that.

2 Likes

ok thanks @learner , i will try that

@rhyolight please do you have any solution of my problem:
i put " set user Dell" but the same error

According to this thread, after setting the environment variable it was necessary for that user to restart the computer.

Since it’s Windows, you probably want to set this from the graphical user interface. From a little Googling, the following process should work for setting an environment variable (not at a windows machine now, so cannot verify – do some Googling yourself if this is not correct):

  • From the desktop, right click the Computer icon.
  • Choose Properties from the context menu.
  • Click the Advanced system settings link.
  • Click Environment Variables
  • Click New under User variables (you could also put it under System variables if you are the only user)
  • Enter USER for the Variable name
  • Enter dell for the Variable value (or whatever username you logged into the computer with)
  • (Save everything and) Reboot

Once logged back in after rebooting, open the command prompt and verify that the environment variable is set by entering:

ECHO %USER%

(should output “dell”, or whatever value you set it to)

Attention to detail is an important dev skill, BTW :stuck_out_tongue_winking_eye:

Summary
2 Likes

Yes, I put SET USER=dell (it’s just a mistake in the comment) and when I verify the user name with the command prompt I find USERNAME=dell but the same error, know I follow the same steps in your comment and finally its work, thanks @Paul_Lamb

1 Like