From d73e5b46348f6d791295c824bebe18835fc5e292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ata=20=C4=B0lhan=20K=C3=B6kt=C3=BCrk?= <87649216+atailh4n@users.noreply.github.com> Date: Wed, 4 Jun 2025 14:26:13 +0300 Subject: [PATCH 1/4] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 2d07e04c..bb941f3b 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,16 @@ GPU accelerated Neural networks in JavaScript for Browsers and Node.js ### NPM +> [!CAUTION] +> Before installing brain.js, you must install `setuptools` with administrative privileges. +> Since Python 3.12, the distutils module has been removed from the standard library. Many tools that previously depended on distutils now rely on setuptools instead. +> To proceed, open PowerShell as Administrator and run the following command: +> ```ps +> pip install setuptools +>``` +> After successful installation, you can continue with the installation of brain.js. +> [According to this GitHub Issue](https://github.com/BrainJS/brain.js/issues/930), this step resolves the installation error caused by missing `distutils`. + If you can install `brain.js` with [npm](http://npmjs.org): ```bash From e82b2ac6b09eb9202cbc9372e98bbf8cfb40e3f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ata=20=C4=B0lhan=20K=C3=B6kt=C3=BCrk?= <87649216+atailh4n@users.noreply.github.com> Date: Wed, 4 Jun 2025 14:28:06 +0300 Subject: [PATCH 2/4] Update README.md Added distutils warning --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bb941f3b..54494415 100644 --- a/README.md +++ b/README.md @@ -67,11 +67,9 @@ GPU accelerated Neural networks in JavaScript for Browsers and Node.js ## Installation and Usage -### NPM - > [!CAUTION] > Before installing brain.js, you must install `setuptools` with administrative privileges. -> Since Python 3.12, the distutils module has been removed from the standard library. Many tools that previously depended on distutils now rely on setuptools instead. +> Since Python 3.12, the `distutils` module has been removed from the standard library. Many tools that previously depended on `distutils` now rely on `setuptools` instead. > To proceed, open PowerShell as Administrator and run the following command: > ```ps > pip install setuptools @@ -79,6 +77,7 @@ GPU accelerated Neural networks in JavaScript for Browsers and Node.js > After successful installation, you can continue with the installation of brain.js. > [According to this GitHub Issue](https://github.com/BrainJS/brain.js/issues/930), this step resolves the installation error caused by missing `distutils`. +### NPM If you can install `brain.js` with [npm](http://npmjs.org): ```bash From e1c558a5f8e2a2b9dfd653d43c99b801f09dc2fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ata=20=C4=B0lhan=20K=C3=B6kt=C3=BCrk?= <87649216+atailh4n@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:55:21 +0300 Subject: [PATCH 3/4] Update comments --- README.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 54494415..3ac54808 100644 --- a/README.md +++ b/README.md @@ -68,14 +68,29 @@ GPU accelerated Neural networks in JavaScript for Browsers and Node.js ## Installation and Usage > [!CAUTION] -> Before installing brain.js, you must install `setuptools` with administrative privileges. -> Since Python 3.12, the `distutils` module has been removed from the standard library. Many tools that previously depended on `distutils` now rely on `setuptools` instead. -> To proceed, open PowerShell as Administrator and run the following command: +> Before installing brain.js, make sure `setuptools` is installed with administrative privileges. +> Since **Python 3.12**, the `distutils` module has been removed from the standard library. Many tools that previously depended on `distutils` now rely on `setuptools`. +> To avoid installation errors, open PowerShell as Administrator and run: > ```ps > pip install setuptools >``` -> After successful installation, you can continue with the installation of brain.js. -> [According to this GitHub Issue](https://github.com/BrainJS/brain.js/issues/930), this step resolves the installation error caused by missing `distutils`. +> [Reference: GitHub Issue Comment](https://github.com/BrainJS/brain.js/issues/930#issuecomment-2155350536)\ +> [Reference: Python Standart Library: distutils](https://docs.python.org/3/library/distutils.html) + +> [!NOTE] +> Some users may encounter issues due to an outdated `node-gyp` version (< 10), which leads to similar errors related to the missing `distutils` module. +> To fix this, you can use the overrides field in your `package.json` file to force compatible versions of sub-dependencies: +> ```json +> "overrides": { +> "brain.js": { +> "gpu.js": { +> "gl": "^8.1.6" +> } +> }, +> "node-gyp": "^10.2.0" +>} +>``` +> [Reference: GitHub Issue Comment](https://github.com/BrainJS/brain.js/issues/930#issuecomment-2818251889) ### NPM If you can install `brain.js` with [npm](http://npmjs.org): From 500dd00d83b5ec888e4814b65125e9400219e12e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ata=20=C4=B0lhan=20K=C3=B6kt=C3=BCrk?= <87649216+atailh4n@users.noreply.github.com> Date: Wed, 4 Jun 2025 19:58:10 +0300 Subject: [PATCH 4/4] Commit suggestion for README Co-authored-by: Christian Clauss --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ac54808..afd8a3e7 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ GPU accelerated Neural networks in JavaScript for Browsers and Node.js > pip install setuptools >``` > [Reference: GitHub Issue Comment](https://github.com/BrainJS/brain.js/issues/930#issuecomment-2155350536)\ -> [Reference: Python Standart Library: distutils](https://docs.python.org/3/library/distutils.html) +> [Reference: Python Standard Library: distutils](https://docs.python.org/3/library/distutils.html) > [!NOTE] > Some users may encounter issues due to an outdated `node-gyp` version (< 10), which leads to similar errors related to the missing `distutils` module.