htm.core icon indicating copy to clipboard operation
htm.core copied to clipboard

Docker: Installing matplotlib

Open javadan opened this issue 3 years ago • 4 comments

Hi

I'm trying to run this nupic.critic code

and I started with the official nupic docker, numenta/nupic, but pip wouldn't install anything because of 'SNIMissingWarning', which prevents urllib3 from doing something, blah blah blah, and the internet suggests installing pyOpenSSL but I can't get that to install either.

Ok, so I give up, and now I've found htm.core. Neither docker install builds, but I modify it to install pip/pip3 correctly, and give it a bash.

So I need matplotlib as a pre-req, and so I try pip/pip3 install it. And it gives this error:

  src/py_adaptors.h:13:10: fatal error: numpy/arrayobject.h: No such file or directory
     13 | #include "numpy/arrayobject.h"

(It's using Python 3.9) And the build fails. All the advice I've found suggests linking this file elsewhere. But the file doesn't exist. I grepped the /usr/lib folder for it. Not there. Numpy is there. But not this file.

So I'm back to the drawing board. Anyone tried to use the Dockers recently?

Should I maybe just switch the base to an OS like Ubuntu? Or try with Python 3.6/7/8?

I presume all this stuff is happening because Alpine or Python 3.9 is a bit iffy. But I don't know.

Thanks

javadan avatar Sep 22 '21 16:09 javadan

Hi,

If you try Ubuntu, do not go for the latest version Ubuntu-20-LTS because that uses python 3.9 which we have not yet released a binary build for.

IIRC htm.core should just work on ubuntu 18-LTS.

HTH

ctrl-z-9000-times avatar Sep 24 '21 12:09 ctrl-z-9000-times

Hmm thanks. Still stuck. Seems like the code has dependencies on files in nupic.core that aren't around anymore.

from nupic.data.inference_shifter import InferenceShifter from nupic.frameworks.opf.model_factory import ModelFactory

I can use the numenta/nupic docker to get these classes, but then I get stuck with the urllib3 / mathplotlib docker install.

Hmm. I tried pip installing nupic but it does Downloading nupic-0.5.6.tar.gz (4.6 MB) Downloading nupic-0.5.5.tar.gz (4.6 MB) Downloading nupic-0.5.4.tar.gz (4.6 MB) etc.

Any idea how I might get both nupic and mathplotlib working together?

Or, maybe how was InferenceShifter ported to htm.core? Not sure where to go from here. Might need to look into autoencoder based anomaly detection instead. Basically trying to do unsupervised anomaly detection on audio.

javadan avatar Oct 06 '21 23:10 javadan

Uhh, I probably should have noticed this sooner but nupic.critic requires nupic (not htm.core) which was the predecessor of this project. Nupic is difficult to install, as you found out...

You could try porting the old nupic.critic encoder to the new htm.core library?

There is also this other HTM-community project for encoding audio, but I'm not sure if that repo has a working encoder either. https://github.com/htm-community/nupic.audio

ctrl-z-9000-times avatar Oct 07 '21 11:10 ctrl-z-9000-times

Thanks, yeah, that one also looks like it's dependent on the old Nupic, and uses matplotlib too. So I will run into that urllib3 bug again. I'll probably try bash my head against docker/matplotlib/urllib3 for a bit - I see that this bug is supposed to go away for python >= 2.7.9. So maybe I can change the python version in the docker, and get a bit farther.

But if that doesn't work, I'll try port nupic.audio or nupic.critic code to htm.core, one of these weekends. I have a pretty shallow understanding of the codebases, at the moment, so it's a bit daunting.

javadan avatar Oct 07 '21 12:10 javadan