interpretml / interpret

Fit interpretable models. Explain blackbox machine learning.
https://interpret.ml/docs
MIT License
6.04k stars 715 forks source link

Development installation: Requirements? #512

Open DerWeh opened 2 months ago

DerWeh commented 2 months ago

I tried to install interpret as I want to contribute. However, following the instructions in https://interpret.ml/docs/installation-guide.html causes errors. It's probably some fault from my side, as I have no knowledge of JavaScript.

Executing the documented steps yields the error:

$ cd interpret/scripts
$ make install
cd /home/andreasw/workspace/code/develop/interpret/shared/vis && npm install
/bin/sh: 1: npm: not found
Makefile:85: recipe for target 'build-javascript' failed
make: *** [build-javascript] Error 127

So I installed npm

$ sudo apt install npm

Now I get the following error:

make install
cd /home/andreasw/workspace/code/develop/interpret/shared/vis && npm install
loadDep:react-select → ad ▐ ╢████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
npm ERR! Linux 5.4.0-150-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror     at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror     at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror     at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror     at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror     at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror     at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror     at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror     at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/andreasw/workspace/code/develop/interpret/shared/vis/npm-debug.log
Makefile:85: recipe for target 'build-javascript' failed
make: *** [build-javascript] Error 1

Am I doing something wrong, or do I need additional dependencies? In general, it would be good to list the minimal requirements necessary to build interpret (or interpret-core).

Another question would be concerning the Python version. The REAMDE suggests that Python 3.7 is still supported, the setup.py suggests that Python 3.8 is required, and the docs recommend Python 3.10. I think it is most appropriate to use the oldest supported Python version for development to make sure all used features are available; but to me, it is not clear which is the minimum version required. I couldn't find any hard constrain, only documentation.

paulbkoch commented 2 months ago

Hi @DerWeh -- Thanks for letting us know about this. I'll add the information to install npm in the documentation once we resolve the rest of the issues you're observing.

node v8.10.0 and npm v3.5.2 are pretty old (2018/2015). Can you try updating them with:

sudo apt update sudo apt install nodejs npm

DerWeh commented 2 months ago

Indeed, the Ubuntu on my machine is quite old (and I have some constrains not allowing me to upgrade).

Tried it on a different machine with a newer Ubuntu.

$ nodejs --version
v12.22.9
$ npm --version
8.5.1

With the newer version, the command runs with the following output:

$ make install
cd /home/wehandre/workspace/code/interpret/shared/vis && npm install
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated mumath@3.3.4: Redundant dependency in your project.
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

added 1127 packages, and audited 1128 packages in 2m

150 packages are looking for funding
  run `npm fund` for details

4 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
cd /home/wehandre/workspace/code/interpret/shared/vis && npm run build-prod

> @interpretml/interpret-inline@0.5.1 build-prod
> webpack --mode production

events.js:291
      throw er; // Unhandled 'error' event
      ^

Error [ERR_WORKER_OUT_OF_MEMORY]: Worker terminated due to reaching memory limit: JS heap out of memory
    at Worker.[kOnExit] (internal/worker.js:238:26)
    at Worker.<computed>.onexit (internal/worker.js:168:20)
Emitted 'error' event on Worker instance at:
    at Worker.[kOnExit] (internal/worker.js:238:12)
    at Worker.<computed>.onexit (internal/worker.js:168:20) {
  code: 'ERR_WORKER_OUT_OF_MEMORY'
}
make: *** [Makefile:86: build-javascript] Error 1

I'm not really interested in developing dashboards and visualizations, so it seems it's fine to just use

$ chmod u+x build.sh
$ ./build.sh

followed by installing the Python module. The relevant test are passing, so this is good enough for me (but it might be useful to document it for other developers).