Can I install nupic under Windows Subsystem for Linux?

In Windows 10 64-bit I have enabled Windows Subsystem for Linux, which gives me Bash on Ubuntu 14.04 LTS on Windows.

Can I install nupic under this subsystem?

1 Like

I don’t know. Try it out and let us know!

$ pip install nupic
Downloading/unpacking nupic
  Downloading nupic-0.6.0-py2-none-any.whl (4.8MB): 4.8MB downloaded
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle,
    bundle=self.bundle)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1266, in prepare_files
    req_to_install.extras):
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2291, in requires
    dm = self._dep_map
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2484, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2517, in
    _compute_dependencies
    common = frozenset(reqs_for_extra(None))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2514, in reqs_for_extra
    if req.marker_fn(override={'extra':extra}):
  File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/_markerlib/markers.py",
    line 113, in marker_fn
    return eval(compiled_marker, environment)
  File "<environment marker>", line 1, in <module>
NameError: name 'platform_system' is not defined

Make sure the environment has these dependencies installed.

Once I created a virtualenv (and then installed required dependencies) things went smoothly so it seems like pip install nupic installed without error.

Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import nupic
>>>

Is there something else I can do to test the installation?

Can you try running the simple hotgym example without swarming?

> cd examples/opf/clients/hotgym/simple
> python hotgym.py
INFO:__main__:After 100 records, 1-step altMAPE=38.390240
INFO:__main__:After 200 records, 1-step altMAPE=29.214768
INFO:__main__:After 300 records, 1-step altMAPE=25.829702
INFO:__main__:After 400 records, 1-step altMAPE=24.262638
INFO:__main__:After 500 records, 1-step altMAPE=22.976900
INFO:__main__:After 600 records, 1-step altMAPE=22.890111
INFO:__main__:After 700 records, 1-step altMAPE=22.579927
INFO:__main__:After 800 records, 1-step altMAPE=22.859475
INFO:__main__:After 900 records, 1-step altMAPE=23.299378
INFO:__main__:After 1000 records, 1-step altMAPE=23.396538

If you get output like this, NuPIC is probably installed properly.

Thought I was close. Any idea?

$ python hotgym.py
Traceback (most recent call last):
  File "hotgym.py", line 31, in <module>
    from nupic.frameworks.opf.modelfactory import ModelFactory
  File "/home/realuser/venvs/nupic1/local/lib/python2.7/site-packages/nupic/frameworks/opf/modelfactory.py", line 32, in <module>
    from clamodel import CLAModel
  File "/home/realuser/venvs/nupic1/local/lib/python2.7/site-packages/nupic/frameworks/opf/clamodel.py", line 53, in <module>
    import capnp
  File "/home/realuser/venvs/nupic1/local/lib/python2.7/site-packages/capnp/__init__.py", line 34, in <module>
    from .version import version as __version__
  File "/home/realuser/venvs/nupic1/local/lib/python2.7/site-packages/capnp/version.py", line 4, in <module>
    from .lib.capnp import _CAPNP_VERSION_MAJOR as LIBCAPNP_VERSION_MAJOR
  File "capnp/lib/capnp.pyx", line 1620, in init capnp.lib.capnp (capnp/lib/capnp.cpp:89810)
  File "capnp/lib/capnp.pyx", line 1605, in capnp.lib.capnp._EventLoop.__init__ (capnp/lib/capnp.cpp:35131)
capnp.lib.capnp.KjException: src/kj/async-unix.c++:262: failed: signalfd(-1, &signalFdSigset, SFD_NONBLOCK | SFD_CLOEXEC): Invalid argument
stack: 0x7f08ce2d1de9 0x7f08ce2d54ef 0x7f08ce2ce16c 0x7f08ce2c0ce0 0x7f08ce1ca794 0x7f08ce188cff 0x55f6db 0x7f08ce12775f 0x7f08ce1a2d99 0x427992 0x55642f 0x556838 0x5570ae 0x569cd8 0x4c8c8b 0x5264a8

If you want to check the installation without the repository handy, you can execute the following command line tool that gets installed by nupic.bindings (which is a dependency of nupic):

nupic-bindings-check

That will be installed in the bin directory inside the prefix you used to install the package so the bin path must be part of your PATH environment variable. If you need help with this then post the result of this:

python -c "import nupic; print nupic.__file__"

That doesn’t look good - looks like it could be a Windows-specific issue.

You could try installing capnp manually:

curl -O https://capnproto.org/capnproto-c++-0.5.3.1.tar.gz
tar zxf capnproto-c++-0.5.3.1.tar.gz
cd capnproto-c++-0.5.3.1
./configure
make -j6 check
sudo make install

Seems to compile ok but then looks like Test suite fails. So I guess it’s an issue with Capn Proto and WSL (Windows Subsystem for Linux)

PASS: capnp-evolution-test
FAIL: capnp-test
PASS: src/capnp/compiler/capnp-test.sh
============================================================================
Testsuite summary for Capn Proto 0.5.3.1
============================================================================
# TOTAL: 3
# PASS:  2
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

Between https://github.com/numenta/nupic/blob/master/appveyor.yml and https://github.com/numenta/nupic/blob/master/ci/appveyor/install_python_pip.ps1, which we use for windows CI builds there may be enough details to get it up and running on Windows on your own, independent of the Ubuntu Linux subsystem. There are equivalent files in nupic.core for building it from source.

1 Like