NuPIC 0.7.0 macOS 10.10.5 installation problems


#41

This is the problem.

What does config.log say?


#42

hmm… where does pip put config.log?
I am running Xcode 9 though, so I wonder if the developer tools are too new(?)
Looks like my system only has LLVM + Clang… no gcc. Installing now


#43

Okay, I installed gcc (via conda), but same error(s). Is it because I’m using conda?


#44

I was able to replicate your problem, and here is my workaround.

Try downloading capnproto-c+±0.6.0 tarball separately.

cd capnproto-c++-0.6.0/
./configure
make
sudo make install
CFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++" pip install pycapnp --user

That seems to work for me.


#45

I have to step away for a bit, but will try a little later.
Thanks for your help. Much appreciated.


#46

Well, this fails during “make”:

dyld: lazy symbol binding failed: Symbol not found: __ZNKSt8__detail20_Prime_rehash_policy11_M_next_bktEm
          Referenced from: /Users/jbmaxwell/capnproto-c++-0.6.0/.libs/libcapnpc-0.6.0.dylib (which was built for Mac OS X 10.12)
          Expected in: /usr/lib/libstdc++.6.dylib

dyld: Symbol not found: __ZNKSt8__detail20_Prime_rehash_policy11_M_next_bktEm
  Referenced from: /Users/jbmaxwell/capnproto-c++-0.6.0/.libs/libcapnpc-0.6.0.dylib (which was built for Mac OS X 10.12)
  Expected in: /usr/lib/libstdc++.6.dylib

*** Received signal #6: Abort trap: 6
stack: 
make: *** [test_capnpc_middleman] Error 1

I’m going to be building a Linux box for keras/tensorflow later, so maybe I’ll try again under Ubuntu…


#47

This sounds like progress. Now you can point to the C++ build as the culprit instead of some nebulous python/pip issue.


#48

Wow… okay, up and running on my keras/tensorflow Ubuntu box in about 20 mins!

Do you know if any specific routine is required (or available) to take advantage of cuda?


#49

I have same problems, when install pycapnp that nupic wants:
CFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++" pip install pycapnp==0.5.12

The install process fails.

the errors is :

Collecting pycapnp==0.5.12
  Using cached pycapnp-0.5.12.tar.gz
Building wheels for collected packages: pycapnp
  Running setup.py bdist_wheel for pycapnp ... error
  Complete output from command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/pip-build-izAFjD/pycapnp/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/tmpO9UaWSpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.6-intel-2.7
  creating build/lib.macosx-10.6-intel-2.7/capnp
  copying capnp/__init__.py -> build/lib.macosx-10.6-intel-2.7/capnp
  copying capnp/_gen.py -> build/lib.macosx-10.6-intel-2.7/capnp
  copying capnp/version.py -> build/lib.macosx-10.6-intel-2.7/capnp
  copying capnp/__init__.pxd -> build/lib.macosx-10.6-intel-2.7/capnp
  copying capnp/c++.capnp -> build/lib.macosx-10.6-intel-2.7/capnp
  copying capnp/schema.capnp -> build/lib.macosx-10.6-intel-2.7/capnp
  creating build/lib.macosx-10.6-intel-2.7/capnp/helpers
  copying capnp/helpers/__init__.pxd -> build/lib.macosx-10.6-intel-2.7/capnp/helpers
  copying capnp/helpers/helpers.pxd -> build/lib.macosx-10.6-intel-2.7/capnp/helpers
  copying capnp/helpers/non_circular.pxd -> build/lib.macosx-10.6-intel-2.7/capnp/helpers
  copying capnp/helpers/asyncHelper.h -> build/lib.macosx-10.6-intel-2.7/capnp/helpers
  copying capnp/helpers/capabilityHelper.h -> build/lib.macosx-10.6-intel-2.7/capnp/helpers
  copying capnp/helpers/checkCompiler.h -> build/lib.macosx-10.6-intel-2.7/capnp/helpers
  copying capnp/helpers/fixMaybe.h -> build/lib.macosx-10.6-intel-2.7/capnp/helpers
  copying capnp/helpers/rpcHelper.h -> build/lib.macosx-10.6-intel-2.7/capnp/helpers
  copying capnp/helpers/serialize.h -> build/lib.macosx-10.6-intel-2.7/capnp/helpers
  creating build/lib.macosx-10.6-intel-2.7/capnp/includes
  copying capnp/includes/__init__.pxd -> build/lib.macosx-10.6-intel-2.7/capnp/includes
  copying capnp/includes/capnp_cpp.pxd -> build/lib.macosx-10.6-intel-2.7/capnp/includes
  copying capnp/includes/schema_cpp.pxd -> build/lib.macosx-10.6-intel-2.7/capnp/includes
  copying capnp/includes/types.pxd -> build/lib.macosx-10.6-intel-2.7/capnp/includes
  creating build/lib.macosx-10.6-intel-2.7/capnp/lib
  copying capnp/lib/__init__.pxd -> build/lib.macosx-10.6-intel-2.7/capnp/lib
  copying capnp/lib/capnp.pxd -> build/lib.macosx-10.6-intel-2.7/capnp/lib
  copying capnp/lib/__init__.py -> build/lib.macosx-10.6-intel-2.7/capnp/lib
  copying capnp/lib/pickle_helper.py -> build/lib.macosx-10.6-intel-2.7/capnp/lib
  copying capnp/lib/capnp.pyx -> build/lib.macosx-10.6-intel-2.7/capnp/lib
  creating build/lib.macosx-10.6-intel-2.7/capnp/templates
  copying capnp/templates/module.pyx -> build/lib.macosx-10.6-intel-2.7/capnp/templates
  copying capnp/templates/setup.py.tmpl -> build/lib.macosx-10.6-intel-2.7/capnp/templates
  running build_ext
  creating var
  creating var/folders
  creating var/folders/9q
  creating var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn
  creating var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T
  creating var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/tmpC37Bia
  /usr/bin/clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++ -c /var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/tmpC37Bia/vers.cpp -o var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/tmpC37Bia/vers.o --std=c++11
  /var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/tmpC37Bia/vers.cpp:4:10: fatal error: 'capnp/common.h' file not found
  #include "capnp/common.h"
           ^
  1 error generated.
  *WARNING* no libcapnp detected or rebuild forced. Will download and build it from source now. If you have C++ Cap'n Proto installed, it may be out of date or is not being detected. Downloading and building libcapnp may take a while.
  fetching https://capnproto.org/capnproto-c++-0.5.3.1.tar.gz into /private/var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/pip-build-izAFjD/pycapnp/bundled
  configure: error: in `/private/var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/pip-build-izAFjD/pycapnp/bundled/capnproto-c++':
  configure: error: C compiler cannot create executables
  See `config.log' for more details
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/pip-build-izAFjD/pycapnp/setup.py", line 180, in <module>
      'Topic :: Communications'],
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
      dist.run_commands()
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
      self.run_command(cmd)
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 179, in run
      self.run_command('build')
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run
      self.run_command(cmd_name)
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/private/var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/pip-build-izAFjD/pycapnp/setup.py", line 124, in run
      build_libcapnp(bundle_dir, build_dir)
    File "/private/var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/pip-build-izAFjD/pycapnp/buildutils/build.py", line 21, in build_libcapnp
      raise RuntimeError('Configure failed')
  RuntimeError: Configure failed
  
  ----------------------------------------
  Failed building wheel for pycapnp
  Running setup.py clean for pycapnp
Failed to build pycapnp
Installing collected packages: pycapnp
  Running setup.py install for pycapnp ... error
    Complete output from command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/pip-build-izAFjD/pycapnp/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/pip-Hs_2T5-record/install-record.txt --single-version-externally-managed --compile:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/pip-build-izAFjD/pycapnp/setup.py", line 92, in <module>
        from Cython.Distutils import build_ext as build_ext_c
    ImportError: No module named Cython.Distutils
    
    ----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/pip-build-izAFjD/pycapnp/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/pip-Hs_2T5-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/9q/h7h59b3j2zq9qp2gf3tqc_2c0000gn/T/pip-build-izAFjD/pycapnp/

my MacOS version is 10.11
gcc version show that:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin16.7.0

g++ version is :
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin16.7.0 Thread model: posix

clang++ --version is:
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin16.7.0 Thread model: posix


#50

This looks like a permissions issue.


#51

I’m having the exact came problems. Same setup as jacobeverist. I tried his approach using:
CFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++" pip install pycapnp

It gives a RuntimeError: Configure failed.

It still seems to be using “/Python.framework/Versions/2.7/lib/python2.7/” when it installs. If I’m understanding correctly I want it to be using the Mac installed python, not the Python 2.7 I installed from python.org, which it seems to be using. It’s weird because when I run “which python” command it is running “/usr/bin/python”

Is there some way to force the install to use the Mac system python?


#52

Thanks to @jacobeverist for this solution. I spent a full SEVEN HOURS trying to get Nupic installed on a Mac OS X 10.13 (High Sierra).

I had slight variations in the procedure, including pycapnp version 0.6.3, and pip install pycapnp without the compiler options. Also, my previous configuration was Anaconda Python 3.6, so it took many steps for me to install and configure Python 2.7 and virtualenv to create an environment with 2.7 and packages just for Nupic. Then I installed all the requirements.txt EXCEPT nupic.bindings. Finally I followed steps 1 thru 4, in this post.

To @rhyolight – it would be really great if the Nupic Readme.md page could be updated with better instructions for Mac installation, reflecting these steps.


#53

Where in the README do you think is the best place to put a note or something that links to this solution? Or maybe even better, what are the keywords that would would have brought you to this thread sooner?