Installing nupic on mac

#1

Is there a easy way to install nupic on Mac high Sierra os. I use python 3.7 and python 2.7.
I have tried installed using the threads on installing Nupic. Finally gave up but want to try another time. Appreaciate some good pointers.

0 Likes

#2

You could try installing the community fork of nupic.

We’ve removed a lot of the outdated dependencies & weirdness from nupic. It requires C++11, CMake, and an internet connection (it will automatically download the rest of the dependencies from github). There are instructions for buildings & installing the python portion of the library in the README.

It comes with a big disclaimer: it is still under development and it might not work 100%.
On the other hand, if it doesn’t work we (the volunteers developing it) will try to help fix it.

0 Likes

#3

Thanks . I would like to import nupic. In python and use the nupic algorithms .

Will I need nupic core installation to do this.

Appreciate your inputs

0 Likes

#4

No. The community fork version of Nupic contains all of the materials needed to use the algorithms in python (version 2 and 3).

0 Likes

#5

NuPIC is only available for Python 2.7, where you should be able to run pip install nupic.

For a python 3 version of NuPIC, I suggest you work with the community fork as @dmac suggested.

0 Likes

#6

Thanks. I am now installing with the community fork. It is taking a long time…

I am getting boost download and install takes a while , go get coffee… I finished my lunch now but no signs… is this expected.

0 Likes

#7

Hello

I tried installing the community nupic fork on Mac. Installation starts and doesn’t go beyond getting boost… I left it for the whole night . Am I missing anything or is there requirement to take care of…

0 Likes

#8

@suma I am surprised this is not working for you. One of our unit test environments is OSx so this should work. Boost is only needed if the compiler cannot handle C++17 and std::filesystem. Unfortunately Apple Clang compiler (XCode 10.1) does not support std::filesystem.

The download could take around 15 min or so depending on your internet speed. It is big; around 100Mb.

An alternative is to manually download boost.

  • download from: https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz
  • rm -r ${REPOSITORY_DIR}/build (to clear the cmake cache in ThirdParty)
  • mkdir -p ${REPOSITORY_DIR}/build/scripts
  • mkdir -p ${REPOSITORY_DIR}/build/ThirdParty/share
  • copy to ${REPOSITORY_DIR}/build/ThirdParty/share/boost.tar.gz (note the name change).
  • cd ${REPOSITORY_DIR}/build/scripts
  • cmake …/…

This will not make the boost download run any faster but it might isolate where the problem is. Once downloaded it should compile fairly quickly with the above procedure since we only need to compile the filesystem and system modules from boost.

Let me know if this works for you.

1 Like

#9

Hello David

Thanks for your inputs. I was able to get the installation run but got the following error in the end.

clang: error: no such file or directory: ‘arch’

clang: error: no such file or directory: ‘x86_64’

clang: error: no such file or directory: ‘arch’

clang: error: no such file or directory: ‘x86_64’

clang: error: no such file or directory: ‘arch’

clang: error: no such file or directory: ‘x86_64’

error: command ‘gcc’ failed with exit status 1

Did I miss something? Appreciate your inputs.

0 Likes

#10

Those look like parts of compiler option flags that were in the wrong place.
Can you open a new issue in nupic.cpp repository https://github.com/htm-community/nupic.cpp/issues then post the log for me. I need a little more info as to what it was trying to do when it issued this error.

Thanks.

0 Likes

#11

Hello David

I have added the new issue and the log. Appreciate your inputs. After installing, I would like to import nupic and import anomalylilelyhood from nupic.algorithms in my python application

0 Likes

#12

Resolution: We do not yet support Anaconda Python on the htm-community nupic.cpp repository.

0 Likes

#13

Thanks. I will try with python.org

0 Likes