Installation errors on removing NUMPY on MAC OSX

Hi

I’m struggling to install NUPIC for the first time on my MAC. I seem to be getting weird permissions errors and suspect it is because my Python install isn’t right. This is a work MAC and I inherited the installation. Also I don’t know much python so don’t really understand how the different versions sit together. Looks like I have 2.6 and 2.7 installed with 2.7 being the default.

When I run pip install NUPIC I get this error about a package called numpy:

Installing collected packages: numpy

Found existing installation: numpy 1.13.0
Uninstalling numpy-1.13.0:
Exception:
Traceback (most recent call last):
File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py”, line 342, in run
prefix=options.prefix_path,
File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py”, line 778, in install
requirement.uninstall(auto_confirm=True)
File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py”, line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py”, line 115, in remove
renames(path, new_path)
File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/init.py”, line 267, in renames
shutil.move(old, new)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”, line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: ‘/Library/Python/2.7/site-packages/numpy-1.13.0.dist-info/DESCRIPTION.rst’

Also the installation page says to run this after installation:

From the root of the repo:

py.test tests/unit

But makes no mention of where that is located…

Any help much appreciated

Brad

1 Like

Did you try pip install nupic --user?

Thanks a lot, that seems to have done the trick.

At least no errors now.

I am still not sure all is well though. The phrase "from the root of the repo" suggests I should have cloned this repo first. But the README suggests that simply running pip install nupic is all that’s required. Is that right?

Either way, I am unable to divine where where to run

py.test tests/unit 

to test the installation.

Sorry if I’m sounding dense, but I’m a Ruby guy and haven’t touched Python for years, so pip etc. is a mystery to me.

PS. Really enjoyed the videos, thanks for taking the time. I’m looking forward to trying NUPIC out.

When you run pip install nupic, it installs the binary files from https://pypi.python.org/pypi/nupic so you don’t need the source code. If you want to run tests, you will need the source code associated with the binary installation you installed. I have instructions for doing this here.

Glad you like the videos! I’ll be making a lot more over the next year. :smiley:

Ah thanks for the help. That all make sense now.