2 install tests FAILED, what to make of them?

Hi guys,

So I just installed NuPIC following the instructions from Matt’s February ‘Installing NuPIC on Ubuntu’ video. As I result I had 879 tests passed, 2 failed and 24 skipped. I wanted to show the errors I got to find out: 1) do they mean the software won’t work or not in certain circumstances; and if so 2) what can I do to fix them? As I said I did everything instructed in the video. Thanks!!

Error 1

-------------------------------- Captured stdout ---------------------------------
ERR:  Matching Python module for TPRegion not found. [/home/travis/build/numenta/nupic.core/src/nupic/engine/RegionImplFactory.cpp line 431]
-------------------------------- Captured stderr ---------------------------------
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused

(py.test:2192): Gdk-CRITICAL **: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

Error 2

-------------------------------- Captured stdout ---------------------------------
ERR:  Matching Python module for TPRegion not found. [/home/travis/build/numenta/nupic.core/src/nupic/engine/RegionImplFactory.cpp line 431]
-------------------------------- Captured stderr ---------------------------------
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused

(py.test:2243): Gdk-CRITICAL **: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

Please run the command you used to run the tests again. Paste it, and the entire contents of the console output into gist or pastebin for analysis. Thanks.

Hi Matt,

Awesome, thanks. Here’s the command I ran, its what you did towards the end
of the video:

./scripts/run_nupic_tests.py - u

Here’s the link to the ‘pastebin’ I made for the output. It’s my first time
using it so let me know if there’s anything missing:

http://pastebin.com/MLJttPzH

It will take me some time to get to this. I’m bookmarking it. In the meantime, maybe someone else can help out? The confusing part of the error is right here:

(py.test:4771): Gdk-CRITICAL **: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

You may have a matplotlib problem or even an nvidia problem? But I did not know our unit tests depended upon matplotlib. Any insight would be valuable. Someone could create a new issue about these errors.

Having the same issue here, except that instead of just failing the tests, it’s preventing me from running the Getting Started Example here: http://nupic.docs.numenta.org/stable/quick-start/network.html

ERR:  Matching Python module for TPRegion not found. [/root/bamboo-agent-home/xml-data/build-dir/NUP-CORE-NCRM/src/nupic/engine/RegionImplFactory.cpp line 444]
Traceback (most recent call last):
  File "network.py", line 52, in <module>
network.addRegion("TM", "py.TPRegion", json.dumps(tmParams))
  File "/home/mark/Projects/NuPIC/venv/local/lib/python2.7/site-packages/nupic/engine/__init__.py", line 639, in addRegion
engine_internal.Network.addRegion(self, name, nodeType, nodeParams)
  File "/home/mark/Projects/NuPIC/venv/local/lib/python2.7/site-packages/nupic/bindings/engine_internal.py", line 1167, in addRegion
return _engine_internal.Network_addRegion(self, *args, **kwargs)
RuntimeError: Matching Python module for TPRegion not found.

Please tell me what version of nupic you have installed so I can help.

Sure thing.

$ pip show nupic
Name: nupic
Version: 1.0.3
Summary: Numenta Platform for Intelligent Computing
Home-page: https://github.com/numenta/nupic
Author: Numenta
Author-email: help@numenta.org
License: UNKNOWN
Location: /home/mark/Projects/NuPIC/venv/lib/python2.7/site-packages
Requires: validictory, PyMySQL, unittest2, ordereddict, psutil, prettytable, PyYAML, pytest-cov, pytest, pyproj, pycapnp, python-dateutil, numpy, asteval, mock, pytest-xdist, DBUtils, nupic.bindings, coverage

You might have the wrong version of nupic.bindings installed. Can you please run the instructions I linked in the last message and show me your stdout?

Sorry about that! Here’s that output.

$ python -c 'import pkg_resources;n=pkg_resources.get_distribution("nupic");b=pkg_resources.get_distribution("nupic.bindings");print n.project_name, n.version;print b.project_name, b.version'
nupic 1.0.3
nupic.bindings 1.0.0

I just installed nupic 1.0.3 / nupic.bindings 1.0.0 (via pip install nupic==1.0.3 --user and ran the complete network example here and had no problems:

> python docs/examples/network/complete-network-example.py
1-step:    21.2000007629 (100.0%)	 5-step:    21.2000007629 (100.0%)
1-step:    16.3999996185 (0.1996%)	 5-step:    16.3999996185 (0.1996%)
1-step:    4.69999980927 (0.1996%)	 5-step:    4.69999980927 (0.1996%)
1-step:    4.69999980927 (0.1996%)	 5-step:    4.69999980927 (0.1996%)
1-step:    4.59999990463 (0.1996%)	 5-step:    4.59999990463 (0.1996%)
1-step:             23.5 (0.1996%)	 5-step:             23.5 (0.1996%)
1-step:             47.5 (0.1984%)	 5-step:             47.5 (0.1984%)
1-step:    45.4000015259 (0.1883%)	 5-step:    45.4000015259 (0.1883%)
1-step:    46.0999984741 (0.1883%)	 5-step:    46.0999984741 (0.1883%)
etc.

Are you sure you don’t have artifacts of some older installation of nupic or nupic.bindings somewhere? Can you do a complete uninstall and try again?

Aha! I found out where I got messed up. In the quick start guide there is some code in the Add a temporal memory region section:

tmParams = modelParams["tmParams"]
network.addRegion("TM", "py.TPRegion", json.dumps(tmParams))

Maybe just a typo? Anyway, that’s where I coped and pasted from… either way, I’m up and running now. Thank you!

Oh wow, you’re right! I updated the main example program to run (because we run it in our test suite), but I did not update the code snippets. Those don’t get run in tests. :sweat_smile: I will have a fix in a PR soon. Thanks for reporting!

Fixed, will merge when CI completes.

Awesome, thanks again for your help