Running the Numenta Software on Ubuntu 9.10 Linux
Recently, I have been experimenting with Numenta’s Vision Toolkit and NuPIC software. These two noteworthy products let developers, researchers and individuals alike create intelligent apps that can recognize objects or perform other complex tasks that involve learning, inference and prediction. Both tools are available from the Numenta website, albeit under a “play but don’t deploy” research license.
Windows and Mac OS X users can download the program, install and play right away. Life for Linux users is not as sweet, requiring some workarounds. Having done the install myself, I made this tutorial to help other Linux users get past the hurdles. I installed on Ubuntu 9.10 but you should be able to tweak these instructions for other Linux distros.
Installing the Vision Toolkit
- Install Wine (“Windows emulator”). I don’t exactly recall where I found the instruction… maybe in the Ubuntu Wine documentation page
- Download the Vision Toolkit program (requires login)
- Right click on the downloaded NumentaVisionToolkit-<version>.exe, select Open with Wine Windows Program Loader from the menu and follow the Windows setup.
- When the install completes, you should see an icon like the one below on your desktop. Double-click and prepare to conquer the world.
![]()
Installing NuPIC
If you follow the NuPIC installation instructions for Linux on the Numenta website, you’ll find that it breaks with the latest Ubuntu (version 9.10 as of this writing). The problem is that the latest Ubuntu comes with Python 2.6 pre-installed. On the other hand, NuPIC 1.7.1 which was released last year is bundled with Python 2.5 packages. As a result, when you run the sample programs such as Bitworm (the “Hello World!” analogue of the HTM) you will be greeted with an error like this:
The last line reveals the culprit– NuPIC is looking for the shared Python library libpython2.5.so.1.0 which does not exist. There are at least two ways to fix this:
- Use symbolic links to fool NuPIC into thinking that it is using Python 2.5 components (e.g., softlink libpython2.5.so.1.0 to the corresponding 2.6 shared library)
- Make NuPIC work with Python 2.6
I did the latter because it looks like the cleaner solution. Besides I also use Python 2.6 packages such as numpy and matplotlib for other projects.
Let’s fix it!
1) According to the install guide, we need a Python interpreter that supports 4-byte Unicode (aka “wide Unicode”) and shared libraries. Fortunately, the Python build that ships with Ubuntu 9.10 already comes with these features.
[Optional] If you’re curious to see if your Python interpreter really supports wide Unicode, see the note at the end of this article.
2) Follow Steps 2 to 6 of the Numenta install guide, with one exception: in Step 5, set the PYTHONPATH to point to your python2.6 folder like this:
export PYTHONPATH=$NTA/lib/python2.6/site-packages:$PYTHONPATH
Don’t forget Step 6. (And yes, we’ll create a python2.6 folder next).
3.) At this point, we diverge from the Numenta install guide. If you poke around, you will see that the tarball saved NuPIC’s required Python packages under $HOME/nta/current/lib/python2.5/site-packages. Instead of hackingpatching the existing obsolete files, we will clone the nupic folder and install the remaining packages directly from the Web. Here goes:
% cd $HOME/nta/nupic-1.7.1-linux32/lib
% mkdir python2.6
% mkdir python2.6/site-packages
% cp -pr python2.5/site-packages/nupic python2.6/site-packages
5) Optional, but recommended.
% sudo apt-get update
6) Install matplotlib and numpy packages
% sudo apt-get python-matplotlib
(NOTE: matplotlib is an powerful graphing and visualization tool (example below). Installing it also auto-installs other packages that NuPIC needs.)
7) Install IPython as your interactive Python environment.
% sudo apt-get install python-setuptools
% sudo easy_install IPython
8. Next, verify that matplotlib and IPython installed properly.
% ipython -pylab
In the IPython shell, type these commands:
x = randn(10000)
hist(x, 100)
You should see a new window with a Bell curve like the following:
Type quit() to quit.
8.) Finally, let’s run the BitWorld demo:
% cd $HOME/nta/current/share/projects/bitworm
% cd $HOME/nta/current/share/projects/bitworm
% python RunOnce.py
The output will be the file report.txt. However, all is not well. While the report.txt is correct and you can see the results in the file, the plotting is broken. I’ll work on this next time.

PS - If you encounter problems and/or find a solution, please let me know.
Credits
Samiux’s Blog – installing IPython on Ubuntu
The matplotlib team – installing matplotlib
—
How to check if wide-Unicode support is enabled in Python
- Open a Terminal console by clicking Applications -> Accessories -> Terminal and call python:% python
- In the interpreter, enter this command: unichr(2**17)
You should get the result: u’\U00020000; if you get a ValueError instead, you don’t have wide Unicode support so recompile Python with this feature enabled.


Thank you for easy readable instruction, but my computer says me precisely the same as before applying it.
serge@serge-laptop:~/?????/nta/current/share/projects/bitworm$ python RunOnce.py
Traceback (most recent call last):
File “RunOnce.py”, line 39, in
from GenerateData import generateBitwormData, generateIncoherentBitwormData
File “/home/serge/?????/nta/nupic-1.7.1-linux32/share/projects/bitworm/GenerateData.py”, line 18, in
from nupic.analysis import netexplorer
ImportError: No module named nupic.analysis
May be I’ve done some dumb mistake?
Hi Serge,
Thanks for reading my blog. I am not at my home computer right now so I cannot check, but I think you just need to set your PYTHONPATH variable to include the path to the “nupic*” folder. This would be the folder that contains the “analysis” and other modules.
Pls let me know if that works.
Ben
Serge,
I had the same problem. It’s related to the symbolic link suggested by the nupic instructions. Changing:
export PYTHONPATH=$NTA/lib/python2.6/site-packages:$PYTHONPATH
to
export PYTHONPATH=$NTA/current/lib/python2.6/site-packages:$PYTHONPATH
solved the problem.