# Py.test tests/unit errors

**URL:** <https://discourse.numenta.org/t/py-test-tests-unit-errors/2457>\
**Category:** NuPIC\
**Tags:** installation\
**Created:** [June 27, 2017, 2:17am UTC](https://discourse.numenta.org/t/py-test-tests-unit-errors/2457 "2017-06-27T02:17:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pegasus](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/pegasus/32/1383_2.png) [@Pegasus](https://discourse.numenta.org/u/Pegasus)\
**Post date:** [June 27, 2017, 2:17am UTC](https://discourse.numenta.org/t/py-test-tests-unit-errors/2457/1 "2017-06-27T02:17:26Z")

</div>

```auto
============================= test session starts ==============================
platform darwin -- Python 2.7.13, pytest-3.0.7, py-1.4.34, pluggy-0.4.0
rootdir: /Users/pegasus/Documents/nupic/nupic, inifile:
plugins: xdist-1.16.0, cov-2.5.0
collected 279 items / 49 errors 

==================================== ERRORS ====================================
_ ERROR collecting tests/unit/nupic/algorithms/anomaly_likelihood_jeff_test.py _
tests/unit/nupic/algorithms/anomaly_likelihood_jeff_test.py:35: in <module>
    from nupic.algorithms import anomaly_likelihood as an
/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nupic/algorithms/ __init__.py:28: in <module>
    from nupic.bindings.algorithms import svm_01, svm_dense
/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nupic/bindings/algorithms.py:119: in <module>
    from nupic.proto.SpatialPoolerProto_capnp import SpatialPoolerProto
capnp/lib/capnp.pyx:3949: in capnp.lib.capnp._Loader.load_module (capnp/lib/capnp.cpp:75559)

```

???  
.  
.  
.

```auto
============================ pytest-warning summary ============================
WC1 /Users/pegasus/Documents/nupic/nupic/tests/unit/nupic/support/decorators_test.py cannot collect test class 'TestParentException' because it has a __init__ constructor
WC1 /Users/pegasus/Documents/nupic/nupic/tests/unit/nupic/support/decorators_test.py cannot collect test class 'TestChildException' because it has a __init__ constructor
!!!!!!!!!!!!!!!!!!! Interrupted: 49 errors during collection !!!!!!!!!!!!!!!!!!!
================= 2 pytest-warnings, 49 error in 6.96 seconds ==================

```

when I run py.test tests/unit, I got this errors, by the way before I got this error, I have struggled for long time to install nupic as I always got errors ,the most frequently occured errors is :’ permission denied …'  
after trying all the possible solutions on the internet, i come across this error.

please help me, thanks…

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [June 27, 2017, 11:42am UTC](https://discourse.numenta.org/t/py-test-tests-unit-errors/2457/2 "2017-06-27T11:42:01Z")

</div>

> [@Pegasus](#):
>
> I have struggled for long time to install nupic as I always got errors ,the most frequently occured errors is :’ permission denied …’

I still don’t think you have NuPIC installed right. What were the steps you took to install, and the console output when the step(s) failed?

---

<div class="post-metadata">

**Author:** ![Pegasus](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/pegasus/32/1383_2.png) [@Pegasus](https://discourse.numenta.org/u/Pegasus)\
**Post date:** [June 28, 2017, 2:27am UTC](https://discourse.numenta.org/t/py-test-tests-unit-errors/2457/3 "2017-06-28T02:27:42Z")

</div>

Hi, Taylor,  
Thanks for your timely response, actually, I don’t think I installed nupic correctly, either. However, I have tried many methods got from the google and this forum.

When I use the command ‘pip install nupic --user’, I got the error:

> Exception:  
> Traceback (most recent call last):  
> File “/usr/local/lib/python2.7/site-packages/pip/basecommand.py”, line 215, in main  
> status = self.run(options, args)  
> File “/usr/local/lib/python2.7/site-packages/pip/commands/install.py”, line 342, in run  
> prefix=options.prefix\_path,  
> File “/usr/local/lib/python2.7/site-packages/pip/req/req\_set.py”, line 784, in install  
> \*\*kwargs  
> File “/usr/local/lib/python2.7/site-packages/pip/req/req\_install.py”, line 851, in install  
> self.move\_wheel\_files(self.source\_dir, root=root, prefix=prefix)  
> File “/usr/local/lib/python2.7/site-packages/pip/req/req\_install.py”, line 1064, in move\_wheel\_files  
> isolated=self.isolated,  
> File “/usr/local/lib/python2.7/site-packages/pip/wheel.py”, line 247, in move\_wheel\_files  
> prefix=prefix,  
> File “/usr/local/lib/python2.7/site-packages/pip/locations.py”, line 153, in distutils\_scheme  
> i.finalize\_options()  
> File “/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py”, line 336, in finalize\_options  
> self.create\_home\_path()  
> File “/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py”, line 555, in create\_home\_path  
> os.makedirs(path, 0700)  
> File “/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 150, in makedirs  
> makedirs(head, mode)  
> File “/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 150, in makedirs  
> makedirs(head, mode)  
> File “/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 150, in makedirs  
> makedirs(head, mode)  
> File “/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 157, in makedirs  
> mkdir(name, mode)  
> OSError: [Errno 13] Permission denied: ‘/Users/pegasus/Library/Python/2.7’

Then add ‘sudo’, like this ‘sudo pip install nupic’.

> The directory ‘/Users/pegasus/Library/Caches/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.  
> The directory ‘/Users/pegasus/Library/Caches/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.  
> Requirement already satisfied: nupic in ./Documents/nupic/nupic/src  
> Requirement already satisfied: asteval==0.9.1 in ./Library/Python/2.7/lib/python/site-packages (from nupic)  
> Requirement already satisfied: coverage==3.7.1 in ./Library/Python/2.7/lib/python/site-packages (from nupic)  
> Requirement already satisfied: mock==1.0.1 in /usr/local/lib/python2.7/site-packages (from nupic)  
> Requirement already satisfied: ordereddict==1.1 in ./Library/Python/2.7/lib/python/site-packages (from nupic)  
> Requirement already satisfied: psutil==1.0.1 in /usr/local/lib/python2.7/site-packages (from nupic)  
> Requirement already satisfied: pytest==3.0.7 in /usr/local/lib/python2.7/site-packages (from nupic)  
> Requirement already satisfied: pytest-cov==2.5.0 in /usr/local/lib/python2.7/site-packages (from nupic)  
> Requirement already satisfied: pytest-xdist==1.16.0 in /usr/local/lib/python2.7/site-packages (from nupic)  
> Requirement already satisfied: python-dateutil==2.1 in /usr/local/lib/python2.7/site-packages (from nupic)  
> Requirement already satisfied: PyYAML==3.10 in ./Library/Python/2.7/lib/python/site-packages (from nupic)  
> Requirement already satisfied: unittest2==0.5.1 in ./Library/Python/2.7/lib/python/site-packages (from nupic)  
> Requirement already satisfied: validictory==0.9.1 in ./Library/Python/2.7/lib/python/site-packages (from nupic)  
> Requirement already satisfied: PyMySQL==0.6.2 in ./Library/Python/2.7/lib/python/site-packages (from nupic)  
> Requirement already satisfied: DBUtils==1.1 in ./Library/Python/2.7/lib/python/site-packages (from nupic)  
> Requirement already satisfied: pyproj==1.9.3 in ./Library/Python/2.7/lib/python/site-packages (from nupic)  
> Requirement already satisfied: prettytable==0.7.2 in ./Library/Python/2.7/lib/python/site-packages (from nupic)  
> Requirement already satisfied: nupic.bindings==0.7.2 in ./Library/Python/2.7/lib/python/site-packages (from nupic)  
> Requirement already satisfied: numpy==1.12.1 in /usr/local/lib/python2.7/site-packages (from nupic)  
> Requirement already satisfied: pycapnp==0.5.12 in /usr/local/lib/python2.7/site-packages (from nupic)  
> Requirement already satisfied: setuptools in /usr/local/lib/python2.7/site-packages (from pytest==3.0.7-\>nupic)  
> Requirement already satisfied: py\>=1.4.29 in /usr/local/lib/python2.7/site-packages (from pytest==3.0.7-\>nupic)  
> Requirement already satisfied: execnet\>=1.1 in /usr/local/lib/python2.7/site-packages (from pytest-xdist==1.16.0-\>nupic)  
> Requirement already satisfied: six in ./Library/Python/2.7/lib/python/site-packages (from python-dateutil==2.1-\>nupic)  
> Requirement already satisfied: apipkg\>=1.4 in /usr/local/lib/python2.7/site-packages (from execnet\>=1.1-\>pytest-xdist==1.16.0-\>nupic)

For this first time, I was so happy that I tried tests ‘py.test tests/unit errors’. Unfortunately. the error occured like illustrated above.

I tried other methods, but none of these possible solutions suits mine.

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [June 28, 2017, 3:38am UTC](https://discourse.numenta.org/t/py-test-tests-unit-errors/2457/4 "2017-06-28T03:38:42Z")

</div>

Do you have the right pip version as described [here](https://github.com/numenta/nupic#dependencies)?

---

<div class="post-metadata">

**Author:** ![Pegasus](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/pegasus/32/1383_2.png) [@Pegasus](https://discourse.numenta.org/u/Pegasus)\
**Post date:** [June 28, 2017, 11:57am UTC](https://discourse.numenta.org/t/py-test-tests-unit-errors/2457/5 "2017-06-28T11:57:20Z")

</div>

Hi, Taylor, thanks for your patience 😄 . Yes, I have got the right pip version (9.01)

python version is 2.7.13 and My MacOS is Sierra version 10.12.4 I don’t know if this matters.

one more thing, in my OS, there is also python 3.6, but I don’t think this will arise some conflicts.

Actually, our team focuses on htm recently which is thought as a very promising algorithm, nevertheless, no one installed nupic successfully. we all use macOS.

We will appreciate it if you kindly offer us a painless installing way. For now, we are all going crazy…😭

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [June 28, 2017, 12:11pm UTC](https://discourse.numenta.org/t/py-test-tests-unit-errors/2457/6 "2017-06-28T12:11:56Z")

</div>

> [@Pegasus](#):
>
> we all use macOS.

That’s not good! We all use macOS too. Usually `pip install nupic --user` works.

---

<div class="post-metadata">

**Author:** ![Pegasus](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/pegasus/32/1383_2.png) [@Pegasus](https://discourse.numenta.org/u/Pegasus)\
**Post date:** [June 28, 2017, 12:28pm UTC](https://discourse.numenta.org/t/py-test-tests-unit-errors/2457/7 "2017-06-28T12:28:13Z")

</div>

Yes, I have watched many your videos on youtube, and I notice that you use MacOS. But is there any thing we could do as this is not an incident-- we all get crashed?

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [June 29, 2017, 10:40pm UTC](https://discourse.numenta.org/t/py-test-tests-unit-errors/2457/8 "2017-06-29T22:40:24Z")

</div>

This seems like a permission problem. Can you try [uninstalling nupic completely](https://discourse.numenta.org/t/uninstalling-nupic/2175)? Then run `pip install nupic --user` and paste the complete console output in a gist.

---

<div class="post-metadata">

**Author:** ![Pegasus](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/pegasus/32/1383_2.png) [@Pegasus](https://discourse.numenta.org/u/Pegasus)\
**Post date:** [July 10, 2017, 1:58am UTC](https://discourse.numenta.org/t/py-test-tests-unit-errors/2457/9 "2017-07-10T01:58:05Z")

</div>

Thanks for your kindly continuously attention. I applied a ‘tough’ method: install nupic in another Mac, which worked except 6 tests error. But this is all right as it is in my ‘receptive field’.  
Thanks…
