Newbie: py.test mostly passed not sure if installation a success

Hi, I wanted to make sure my Nupic installation was a success before moving on to tutorials.

py.test tests/unit (yielded the following results)

==== 3 failed, 743 passed, 17 skipped, 7 pytest-warnings in 252.43 seconds =====

Was the installation a success or does it depend? Please see below what I got in red in console. Thanks!

_ AnomalyLikelihoodAlgorithmTest.testEstimateAnomalyLikelihoodsCategoryValues __

>       ret = umr_sum(arr, axis, dtype, out, keepdims)
E       TypeError: cannot perform reduce with flexible type

_________________ CLAModelTest.testTemporalAnomalyModelFactory _________________

>     return modelClass(**modelConfig['modelParams'])
E     TypeError: __init__() got an unexpected keyword argument 'tmParams'

______________________ ClusterParamsTest.testModelParams _______________________

“Incorrect json for tm_cpp tmImplementation”)
E KeyError: ‘tmParams’

1 Like

As a rule, unit tests must pass 100% before changes are accepted. So any failure in a unit test ought to indicate something wrong, be it an actual error not properly caught during CI (i.e. a process error) or there’s something specific to your installation.

IIRC, we did make some changes re: renaming tpParams to tmParams. Given that the error indicates a problem w/ tm_cpp, I’m guessing that your nupic installation is out of sync w/ your nupic.core/nupic.bindings installation. I’d recommend bringing both up to date, or re-install from binary releases. If you’re still encountering such a failure, please post the versions of nupic and nupic.core/nupic.bindings you’re using, and if installing from source please include relevant commit shas.

For example, to get versions from the command line:

python -c 'from pkg_resources import get_distribution; print "nupic:", get_distribution("nupic").version, "nupic.bindings:", get_distribution("nupic.bindings").version'

To get commit shas (from the root of the checkouts):

git rev-parse HEAD

Thank you Austin!

this is what I got.
nupic: 0.6.0 nupic.bindings: 0.6.0

could this have something to do with the OS? I am working with:
ubuntu 16.04 LTS

I will continue to try to get 100% for the unit tests.

Also see:

If you installed from binaries (e.g. pip install nupic) it’s possible you have an older version of the source code in which the tests are out of sync with what got installed. (Thanks @mrcslws).

I was able to install nupic from binaries and successfully run the tests in an Ubuntu 16.04 LTS container in our Bamboo CI environment at Here’s what I did, including reseting the git repository to the version that matches what was installed (look for the git reset command):

export USER=$(whoami)

apt-get update
apt-get install -y python2.7 python2.7-dev cython curl build-essential cmake git-core

update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --set python /usr/bin/python2.7

curl --silent --show-error --retry 5 -O

python --ignore-installed pip setuptools wheel

pip install nupic

git reset --hard `python -c 'from pkg_resources import get_distribution; print get_distribution("nupic").version'`

py.test tests/unit

Be advised that this was run in a docker container as root and your results may vary.

Thanks Austin, Rhyolight,

I upgraded my RAM from 2G to 8G.

After trying some steps at: Installing NuPIC on Ubuntu 12

Currently at:
nupic: 0.6.1.dev0 nupic.bindings: 0.6.2.dev0
==== 2 failed, 744 passed, 17 skipped, 7 pytest-warnings in 255.12 seconds =====
(1 failed down )

I wonder what the 17 skipped and 7pytest-warnings are about.
And also wondering if installing Ubuntu on Windows/vmware would make any difference since my friends system is configured that way.

Anyhow I will check into your feedback and report back. I am new to GIT as well so it’ll take some time to understand. Thanks!!

current text in red at the console when (py.test tests/unit) :
_____________________ CLAClassifierHelperTest.testAddLabel _____________________

def _raiseerror(self, value):
    err = ParseError(value)
    err.code = value.code
    err.position = value.lineno, value.offset
  raise err

E ParseError: junk after document element: line 9, column 0

_________________ CLAModelTest.testTemporalAnomalyModelFactory _________________

def __getattr__(self, name):
  if not '_region' in self.__dict__:
    raise AttributeError
return getattr(self._region, name)

E AttributeError: ‘Region’ object has no attribute ‘purgeInputLinkBufferHeads’

Hi Rhyolight,

nupic 0.6.0
nupic.bindings 0.6.0

after reinstalling Ubuntu and following the steps you mentioned, I got :
(py.test tests/unit)(prior to git checkout tags/0.6.0 there were 6 failures)
========= 745 passed, 17 skipped, 7 pytest-warnings in 253.01 seconds ==========

did the test pass?!


Thank you very much Austin, Rhyolight!! look forward to getting to the tutorials.