Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker: Installing matplotlib #957

Open
javadan opened this issue Sep 22, 2021 · 4 comments
Open

Docker: Installing matplotlib #957

javadan opened this issue Sep 22, 2021 · 4 comments

Comments

@javadan
Copy link

javadan commented Sep 22, 2021

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

@ctrl-z-9000-times
Copy link
Collaborator

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

@javadan
Copy link
Author

javadan commented Oct 6, 2021

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.

@ctrl-z-9000-times
Copy link
Collaborator

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

@javadan
Copy link
Author

javadan commented Oct 7, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants