Help Building nupic.core (Yosemite)

Ok, try this… Go to your NuPIC repo (not nupic.core, we’re going to try to use the binary installation) and go back to the tag where the release was created.

git checkout 0.5.4
pip uninstall nupic -y
python setup.py develop

This should set you up to change the python source code, but not the C++ source code. Also, this code snapshot is at NuPIC release 0.5.4, but there have been no major changes since our last release, so this should be okay.

I want the columnSegmentWalk code though (just merged in the last two days) because I have to update the TM also?

Well you’ll have to follow this then:

It says this is only for nupic users, not developers? I saw that?

Where does it say that? No, this is for developers. Just run python setup.py develop instead of python setup.py install and you should be fine.

Ok I might have been talking about another movie… I’ll try this… Thanks!

@rhyolight

SUCCESS! :confetti_ball:

ARCHFLAGS not being set was the problem…

EDIT: Also I destroyed my fork and re-forked “core” instead of merging upstream master - I really think merging was a problem…

Now moving on to installing NuPIC

1 Like

@rhyolight

Problem: I run

ARCHFLAGS="-arch x86_64" python setup.py develop (apparently the command no longer requires nor recognizes the source directory variable)

>import nupic.bindings
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named bindings

this runs fine but I still can’t import nupic.bindings from the Python REPL ??

If I run python setup.py develop without the --user flag, I get this error:

> python setup.py develop
running develop
Checking .pth file support in /Library/Python/2.7/site-packages/
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-2092.pth'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /Library/Python/2.7/site-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  https://pythonhosted.org/setuptools/easy_install.html

Please make the appropriate changes for your system and try again.

I’m assuming you don’t get this error? If not, the only reason I can think of is that you (a) are using sudo or (b) have changed the permissions of your system python directories?

I use the --user flag and everything builds executes and tests fine… I just can’t import the nupic.bindings ??

Mindlab:nupic.core cogmission$ python setup.py test

Setup SWIG Python module
running test
running egg_info
writing requirements to nupic.bindings.egg-info/requires.txt
writing nupic.bindings.egg-info/PKG-INFO
writing namespace_packages to nupic.bindings.egg-info/namespace_packages.txt
writing top-level names to nupic.bindings.egg-info/top_level.txt
writing dependency_links to nupic.bindings.egg-info/dependency_links.txt
writing entry points to nupic.bindings.egg-info/entry_points.txt
reading manifest file 'nupic.bindings.egg-info/SOURCES.txt’
writing manifest file 'nupic.bindings.egg-info/SOURCES.txt’
running build_ext
copying build/lib.macosx-10.10-intel-2.7/nupic/dummy.so -> nupic
=========================================================================== test session starts ============================================================================
platform darwin – Python 2.7.10 – pytest-2.5.1
plugins: xdist, cov
collected 7 items

check_test.py …
pyregion_test.py …
temporal_memory_test.py .

========================================================================= 7 passed in 0.10 seconds =========================================================================

But can’t import nupic.bindings

Is there some kind of path variable that needs to be set for it to find nupic.bindings ?

I execute > python

>>> import nupic.bindings

Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named bindings

Well, something is wrong with your installation. :frowning:

Here are all the aliases I use to build from local source:

build-nupic='(cd /Users/mtaylor/nta/nupic && python setup.py develop --user)'
build-nupic-all='build-nupic-core; build-nupic-bindings; build-nupic'
build-nupic-bindings='(cd /Users/mtaylor/nta/nupic.core && ARCHFLAGS="-arch x86_64" python setup.py develop --user)'
build-nupic-core='(mkdir -p /Users/mtaylor/nta/nupic.core/build/scripts && cd /Users/mtaylor/nta/nupic.core/build/scripts && cmake /Users/mtaylor/nta/nupic.core -DCMAKE_INSTALL_PREFIX=../release -DPY_EXTENSIONS_DIR=/Users/mtaylor/nta/nupic.core/bindings/py/nupic/bindings && make -j6 install)'
build-nupic-core-all='build-nupic-core; build-nupic-bindings'

I stole these from @oxtopus. :slight_smile: It allows me to simply run build-nupic-all. You might try uninstalling everything and trying these scripts one by one to see where there are errors in the output.

build-nupic-core
build-nupic-bindings
build-nupic

How do I clean up first before trying these?

Same thing my first post described.

Sure thanks! sorry…

I know how annoying it is to work in an unfamiliar programming environment.

1 Like

@rhyolight

Can you please try the new nupic.core README.md instructions and see if you can afterwards import nupic?

I find it strange that your video pointed out the necessity of using the --nupic-core-dir=$NUPIC_CORE/build/release part on the end of the python setup.py develop command, and now the readme doesn’t specify it anymore and now I can’t import nupic.bindings??

I can however import nupic I just can’t import nupic.bindings ??

The video is older than the README. The README should always be correct. Do what the README says. :slight_smile:

Yeah well it aint workin’ :stuck_out_tongue:

i.e. I build fine, tests run fine but I can’t import nupic.bindings on the command line??