NuPIC installation failure on Ubuntu 16.04.2 LTS

Hi,

I am a newbie here, I tried installing nupic on ubuntu where python version is 2.7, but failed. Does anyone tell me how to fix it? Thanks

ubuntu os information shows as follows:

$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

$ uname -a
Linux S822lc1 4.4.0-81-generic #104-Ubuntu SMP Wed Jun 14 08:15:33 UTC 2017 ppc64le ppc64le ppc64le GNU/Linux

Output of installation is shown below

$ sudo pip install nupic
The directory β€˜/home/asiainfo/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
The directory β€˜/home/asiainfo/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Collecting nupic
Downloading nupic-0.5.6.tar.gz (4.6MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 4.6MB 184kB/s
Collecting asteval==0.9.1 (from nupic)
Downloading asteval-0.9.1.tar.gz
Collecting coverage==3.7.1 (from nupic)
Downloading coverage-3.7.1.tar.gz (284kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 286kB 296kB/s
Collecting mock==1.0.1 (from nupic)
Downloading mock-1.0.1.zip (861kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 870kB 238kB/s
Collecting ordereddict==1.1 (from nupic)
Downloading ordereddict-1.1.tar.gz
Collecting psutil==1.0.1 (from nupic)
Downloading psutil-1.0.1.tar.gz (156kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 163kB 303kB/s
Collecting pytest==2.5.1 (from nupic)
Downloading pytest-2.5.1.tar.gz (577kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 583kB 243kB/s
Collecting pytest-cov==1.6 (from nupic)
Downloading pytest-cov-1.6.tar.gz
Collecting pytest-xdist==1.8 (from nupic)
Downloading pytest-xdist-1.8.zip
Collecting python-dateutil==2.1 (from nupic)
Downloading python-dateutil-2.1.tar.gz (152kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 153kB 292kB/s
Collecting PyYAML==3.10 (from nupic)
Downloading PyYAML-3.10.tar.gz (241kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 245kB 151kB/s
Collecting unittest2==0.5.1 (from nupic)
Downloading unittest2-0.5.1.zip (78kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 81kB 149kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File β€œβ€, line 1, in
File β€œ/tmp/pip-build-74n4ozv7/unittest2/setup.py”, line 12, in
from unittest2 import version as VERSION
File β€œ/tmp/pip-build-74n4ozv7/unittest2/unittest2/init.py”, line 40, in
from unittest2.collector import collector
File β€œ/tmp/pip-build-74n4ozv7/unittest2/unittest2/collector.py”, line 3, in
from unittest2.loader import defaultTestLoader
File β€œ/tmp/pip-build-74n4ozv7/unittest2/unittest2/loader.py”, line 92
except Exception, e:
^
SyntaxError: invalid syntax

----------------------------------------

Command β€œpython setup.py egg_info” failed with error code 1 in /tmp/pip-build-74n4ozv7/unittest2/
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the β€˜pip install --upgrade pip’ command.

The same problem happened when I try in windows 10. the information shows like this:

(D:\Anaconda3) C:\Users\admin>pip install nupic
Collecting nupic
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip.vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001185B90C1D0>, β€˜Connection to pypi.python.org timed out. (connect timeout=15)’)’: /simple/nupic/
Downloading nupic-0.5.6.tar.gz (4.6MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 4.6MB 130kB/s
Collecting asteval==0.9.1 (from nupic)
Downloading asteval-0.9.1.tar.gz
Collecting coverage==3.7.1 (from nupic)
Downloading coverage-3.7.1.tar.gz (284kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 286kB 345kB/s
Collecting mock==1.0.1 (from nupic)
Downloading mock-1.0.1.zip (861kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 870kB 54kB/s
Collecting ordereddict==1.1 (from nupic)
Downloading ordereddict-1.1.tar.gz
Collecting psutil==1.0.1 (from nupic)
Downloading psutil-1.0.1.tar.gz (156kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 163kB 46kB/s
Collecting pytest==2.5.1 (from nupic)
Downloading pytest-2.5.1.tar.gz (577kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 583kB 127kB/s
Collecting pytest-cov==1.6 (from nupic)
Downloading pytest-cov-1.6.tar.gz
Collecting pytest-xdist==1.8 (from nupic)
Downloading pytest-xdist-1.8.zip
Collecting python-dateutil==2.1 (from nupic)
Downloading python-dateutil-2.1.tar.gz (152kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 153kB 137kB/s
Collecting PyYAML==3.10 (from nupic)
Downloading PyYAML-3.10.tar.gz (241kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 245kB 106kB/s
Collecting unittest2==0.5.1 (from nupic)
Downloading unittest2-0.5.1.zip (78kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 81kB 108kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File β€œβ€, line 1, in
File β€œC:\Users\admin\AppData\Local\Temp\pip-build-vc3b6knh\unittest2\setup.py”, line 12, in
from unittest2 import version as VERSION
File "C:\Users\admin\AppData\Local\Temp\pip-build-vc3b6knh\unittest2\unittest2_init
.py", line 40, in
from unittest2.collector import collector
File β€œC:\Users\admin\AppData\Local\Temp\pip-build-vc3b6knh\unittest2\unittest2\collector.py”, line 3, in
from unittest2.loader import defaultTestLoader
File β€œC:\Users\admin\AppData\Local\Temp\pip-build-vc3b6knh\unittest2\unittest2\loader.py”, line 92
except Exception, e:
^
SyntaxError: invalid syntax

----------------------------------------

Command β€œpython setup.py egg_info” failed with error code 1 in C:\Users\admin\AppData\Local\Temp\pip-build-vc3b6knh\unittest2\

You say you are using python 2.7, but are you sure? This error seems to be linked to python 3to2 somehow.

Also, this has already been reported:

https://github.com/numenta/nupic/issues/3732

the python version is 2.7.12, which is shown as follows.
$ which python
/usr/bin/python
$ python --version
Python 2.7.12

Meanwhile, I tried installing from source with the commands below:
git clone https://github.com/numenta/nupic
export NUPIC=~/nupic
cd ~/nupic
sudo python setup.py install

the output of the last command is shown like this.
…
byte-compiling build/bdist.linux-ppc64le/egg/nupic/support/unittesthelpers/algorithm_test_helpers.py to algorithm_test_helpers.pyc
byte-compiling build/bdist.linux-ppc64le/egg/nupic/support/unittesthelpers/abstract_temporal_memory_test.py to abstract_temporal_memory_test.pyc
byte-compiling build/bdist.linux-ppc64le/egg/nupic/support/unittesthelpers/init.py to init.pyc
byte-compiling build/bdist.linux-ppc64le/egg/nupic/support/unittesthelpers/testcasebase.py to testcasebase.pyc
byte-compiling build/bdist.linux-ppc64le/egg/nupic/support/unittesthelpers/test_framework_helpers.py to test_framework_helpers.pyc
byte-compiling build/bdist.linux-ppc64le/egg/nupic/support/configuration_base.py to configuration_base.pyc
byte-compiling build/bdist.linux-ppc64le/egg/nupic/support/fs_helpers.py to fs_helpers.pyc
byte-compiling build/bdist.linux-ppc64le/egg/nupic/support/configuration.py to configuration.pyc
byte-compiling build/bdist.linux-ppc64le/egg/nupic/support/init.py to init.pyc
byte-compiling build/bdist.linux-ppc64le/egg/nupic/support/enum.py to enum.pyc
byte-compiling build/bdist.linux-ppc64le/egg/nupic/support/configuration_custom.py to configuration_custom.pyc
byte-compiling build/bdist.linux-ppc64le/egg/nupic/support/console_printer.py to console_printer.pyc
creating build/bdist.linux-ppc64le/egg/EGG-INFO
copying src/nupic.egg-info/PKG-INFO -> build/bdist.linux-ppc64le/egg/EGG-INFO
copying src/nupic.egg-info/SOURCES.txt -> build/bdist.linux-ppc64le/egg/EGG-INFO
copying src/nupic.egg-info/dependency_links.txt -> build/bdist.linux-ppc64le/egg/EGG-INFO
copying src/nupic.egg-info/namespace_packages.txt -> build/bdist.linux-ppc64le/egg/EGG-INFO
copying src/nupic.egg-info/not-zip-safe -> build/bdist.linux-ppc64le/egg/EGG-INFO
copying src/nupic.egg-info/requires.txt -> build/bdist.linux-ppc64le/egg/EGG-INFO
copying src/nupic.egg-info/top_level.txt -> build/bdist.linux-ppc64le/egg/EGG-INFO
creating β€˜dist/nupic-1.0.4.dev0-py2.7.egg’ and adding β€˜build/bdist.linux-ppc64le/egg’ to it
removing β€˜build/bdist.linux-ppc64le/egg’ (and everything under it)
Processing nupic-1.0.4.dev0-py2.7.egg
removing β€˜/usr/local/lib/python2.7/dist-packages/nupic-1.0.4.dev0-py2.7.egg’ (and everything under it)
creating /usr/local/lib/python2.7/dist-packages/nupic-1.0.4.dev0-py2.7.egg
Extracting nupic-1.0.4.dev0-py2.7.egg to /usr/local/lib/python2.7/dist-packages
nupic 1.0.4.dev0 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/dist-packages/nupic-1.0.4.dev0-py2.7.egg
Processing dependencies for nupic==1.0.4.dev0
Searching for nupic.bindings==1.0.0
Reading https://pypi.python.org/simple/nupic.bindings/
No local packages or working download links found for nupic.bindings==1.0.0
error: Could not find suitable distribution for Requirement.parse(β€˜nupic.bindings==1.0.0’)

I reviewed the requirements.txt in directory ~/nupic, found the line:
nupic.bindings==1.0.0
and tried different version, e.g. 1.0.1 etc. However, install failed as the same

Before installing from source, you should uninstall nupic entirely. Then try installing from source again.

I uninstall nupic and nupic.bindings, reinstall from source again.

:~/nupic$ sudo pip uninstall nupic -y
The directory β€˜/home/asiainfo/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Cannot uninstall requirement nupic, not installed
The directory β€˜/home/asiainfo/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the β€˜pip install --upgrade pip’ command.
:~/nupic$ sudo pip uninstall nupic.bindings -y
The directory β€˜/home/asiainfo/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Cannot uninstall requirement nupic.bindings, not installed
The directory β€˜/home/asiainfo/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the β€˜pip install --upgrade pip’ command.

:~/nupic$ sudo python setup.py install
…
creating β€˜dist/nupic-1.0.4.dev0-py2.7.egg’ and adding β€˜build/bdist.linux-ppc64le/egg’ to it
removing β€˜build/bdist.linux-ppc64le/egg’ (and everything under it)
Processing nupic-1.0.4.dev0-py2.7.egg
removing β€˜/usr/local/lib/python2.7/dist-packages/nupic-1.0.4.dev0-py2.7.egg’ (and everything under it)
creating /usr/local/lib/python2.7/dist-packages/nupic-1.0.4.dev0-py2.7.egg
Extracting nupic-1.0.4.dev0-py2.7.egg to /usr/local/lib/python2.7/dist-packages
nupic 1.0.4.dev0 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/dist-packages/nupic-1.0.4.dev0-py2.7.egg
Processing dependencies for nupic==1.0.4.dev0
Searching for nupic.bindings==1.0.0
Reading https://pypi.python.org/simple/nupic.bindings/
No local packages or working download links found for nupic.bindings==1.0.0
error: Could not find suitable distribution for Requirement.parse(β€˜nupic.bindings==1.0.0’)

Is this a 32bit system?

It is 64bit system

$ getconf LONG_BIT
64

Please paste the output of this command:

pip freeze | grep nupic

asiainfo@S822lc1:~ pip freeze | grep nupic nupic==1.0.4.dev0 asiainfo@S822lc1:~

That confirms that no version of nupic.bindings is installed. Good. Now run

pip install nupic.bindings --user

What happens?

asiainfo@S822lc1:~$ sudo pip install nupic.bindings --user
[sudo] password for asiainfo:
The directory β€˜/home/asiainfo/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
The directory β€˜/home/asiainfo/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Collecting nupic.bindings
Downloading nupic.bindings-1.0.1.tar.gz (3.1MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3.1MB 16kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File β€œβ€, line 1, in
File β€œ/tmp/pip-build-jrsfndjg/nupic.bindings/setup.py”, line 209
print β€œ\nSetup SWIG Python module”
^
SyntaxError: Missing parentheses in call to β€˜print’

----------------------------------------

Command β€œpython setup.py egg_info” failed with error code 1 in /tmp/pip-build-jrsfndjg/nupic.bindings/
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the β€˜pip install --upgrade pip’ command.

asiainfo@S822lc1:~$ pip install nupic.bindings --user
Collecting nupic.bindings
Downloading nupic.bindings-1.0.1.tar.gz (3.1MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3.1MB 114kB/s
Complete output from command python setup.py egg_info:

Setup SWIG Python module
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-xNYv9s/nupic.bindings/setup.py", line 212, in <module>
    version=getVersion(),
  File "/tmp/pip-build-xNYv9s/nupic.bindings/setup.py", line 48, in getVersion
    with open(os.path.join(REPO_DIR, "VERSION"), "r") as versionFile:
IOError: [Errno 2] No such file or directory: '/tmp/VERSION'

----------------------------------------

Command β€œpython setup.py egg_info” failed with error code 1 in /tmp/pip-build-xNYv9s/nupic.bindings/

This is another indication that you are actually running python 3. Sometimes there are multiple versions of python installed on a system. You’ll have to do some digging in your environment to figure this out.

This looks like a permission problem. Make sure you have write access to /tmp.

You are right about runing python 3. the following commands show evidence.

asiainfo@S822lc1:~$ which pip
/usr/bin/pip
asiainfo@S822lc1:~$ /usr/bin/pip -V
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
asiainfo@S822lc1:~$ sudo which pip
/usr/local/bin/pip
asiainfo@S822lc1:~$ /usr/local/bin/pip -V
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)

Now, I run pip with absolute path, only problem of /tmp/VERSION shows up

asiainfo@S822lc1:~$ sudo /usr/bin/pip install nupic.bindings
The directory β€˜/home/asiainfo/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
The directory β€˜/home/asiainfo/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Collecting nupic.bindings
Downloading nupic.bindings-1.0.1.tar.gz (3.1MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3.1MB 35kB/s
Complete output from command python setup.py egg_info:

Setup SWIG Python module
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-ntTMBI/nupic.bindings/setup.py", line 212, in <module>
    version=getVersion(),
  File "/tmp/pip-build-ntTMBI/nupic.bindings/setup.py", line 48, in getVersion
    with open(os.path.join(REPO_DIR, "VERSION"), "r") as versionFile:
IOError: [Errno 2] No such file or directory: '/tmp/VERSION'

----------------------------------------

Command β€œpython setup.py egg_info” failed with error code 1 in /tmp/pip-build-ntTMBI/nupic.bindings/

In order to fix this, you need to figure out what’s wrong in your python environment. The pip in your path should run python 2, and it apparently is running python 3. I don’t think running pip with the absolute path is the right answer.

I managed to install nupic in PyCharm with python2.7 interpreter in windows 10. However, when I run the sine prediction routine in https://github.com/rhyolight/nupic.examples/tree/master/sine-prediction, error shows up as follows, Would you please tell me how to fix it? Thanks

D:\Python27\python.exe D:/vta/python2/nupic/sine-prediction/sine_experiment.py
Generating sine data into sine.csv
Generated 3000 rows of output data into sine.csv
Generating experiment files in directory: D:\vta\python2\nupic\sine-prediction…
Writing 314 lines…
Writing 114 lines…
done.
None
Successfully submitted new HyperSearch job, jobID=1005
Evaluated 0 models
HyperSearch finished!
Worker completion message: None

Results from all experiments:

Generating experiment files in directory: c:\users\admin\appdata\local\temp\tmpnwrvev…
Writing 314 lines…
Writing 114 lines…
done.
None
json.loads(jobInfo.results) raised an exception. Here is some info to help with debugging:
jobInfo: _jobInfoNamedTuple(jobId=1005, client=u’GRP’, clientInfo=u’’, clientKey=u’’, cmdLine=u’$HYPERSEARCH’, params=u’{β€œhsVersion”: β€œv2”, β€œmaxModels”: null, β€œpersistentJobGUID”: β€œcc44179e-b499-11e7-a3e3-34e6d703f017”, β€œuseTerminators”: false, β€œdescription”: {β€œinferenceType”: β€œTemporalAnomaly”, β€œincludedFields”: [{β€œminValue”: -1.0, β€œfieldName”: β€œsine”, β€œfieldType”: β€œfloat”, β€œmaxValue”: 1.0}], β€œinferenceArgs”: {β€œpredictionSteps”: [1], β€œpredictedField”: β€œsine”}, β€œstreamDef”: {β€œinfo”: β€œsine”, β€œversion”: 1, β€œstreams”: [{β€œinfo”: β€œsine.csv”, β€œsource”: β€œfile://sine.csv”, β€œcolumns”: ["*"]}]}, β€œswarmSize”: β€œmedium”}}’, jobHash=’\xccD\x17\x9f\xb4\x99\x11\xe7\xbd04\xe6\xd7\x03\xf0\x17’, status=u’notStarted’, completionReason=None, completionMsg=None, workerCompletionReason=u’success’, workerCompletionMsg=None, cancel=0, startTime=None, endTime=None, results=None, engJobType=u’hypersearch’, minimumWorkers=1, maximumWorkers=8, priority=0, engAllocateNewWorkers=1, engUntendedDeadWorkers=0, numFailedWorkers=0, lastFailedWorkerErrorMsg=None, engCleaningStatus=u’notdone’, genBaseDescription=None, genPermutations=None, engLastUpdateTime=datetime.datetime(2017, 10, 19, 6, 50, 30), engCjmConnId=None, engWorkerState=None, engStatus=None, engModelMilestones=None)
jobInfo.results: None
EXCEPTION: expected string or buffer
Traceback (most recent call last):
File β€œD:/vta/python2/nupic/sine-prediction/sine_experiment.py”, line 103, in
run_sine_experiment()
File β€œD:/vta/python2/nupic/sine-prediction/sine_experiment.py”, line 75, in run_sine_experiment
model_params = swarm_over_data()
File β€œD:/vta/python2/nupic/sine-prediction/sine_experiment.py”, line 68, in swarm_over_data
{β€˜maxWorkers’: 8, β€˜overwrite’: True})
File β€œD:\Python27\lib\site-packages\nupic\swarming\permutations_runner.py”, line 271, in runWithConfig
return _runAction(runOptions)
File β€œD:\Python27\lib\site-packages\nupic\swarming\permutations_runner.py”, line 212, in _runAction
returnValue = _runHyperSearch(runOptions)
File β€œD:\Python27\lib\site-packages\nupic\swarming\permutations_runner.py”, line 155, in runHyperSearch
metricsKeys=search.getDiscoveredMetricsKeys())
File β€œD:\Python27\lib\site-packages\nupic\swarming\permutations_runner.py”, line 822, in generateReport
results = json.loads(jobInfo.results)
File "D:\Python27\lib\json_init
.py", line 339, in loads
return _default_decoder.decode(s)
File β€œD:\Python27\lib\json\decoder.py”, line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or buffer

Process finished with exit code 1

Hi,
Any fix for this ? I’m trying to run this with Python 3.6.2 on windows 10.

Sorry, but we do not support python 3 at this time.

I switched to another machine and it works.

The previous machine is powerpc. Probably the powerpc does not match nupic so well, or there is conflict which I don’t fix it.

Anyway, bypassing the problem is also one acceptable solution.

2 Likes

This seems to be still a problem, if you choose an exotic platform/architecture for NuPIC. I just saw the same issues when trying to install on a bare ubuntu (without desktop/surface) and the the device is an old Android Smartphone :slight_smile:

Just a guess, but I can imagine that NuPIC’s binary/C++ is not compiled for every single architecture. So if someone else is struggling with the described problems (as described above), it might be helpful to rebuild nupic.bindings from source.

I suggest using the htm.core library instead. It does support Python 3.x and also most platforms. You will need to compile from sources. GitHub - htm-community/htm.core: Actively developed Hierarchical Temporal Memory (HTM) community fork (continuation) of NuPIC. Implementation for C++ and Python

2 Likes