Closed travislaynewilson closed 4 months ago
better-sqlite3 itself is not using Python or any Python dependencies but does rely on node-gyp in order to build the native library in case no prebuilt binary is available.
As NodeJS 16 has reached its end of life 5 months ago, it is not covered with prebuilt binaries anymore. If you do not want to deal with setting up a proper build environment, which would also require a more up to date version of node-gyp, the easiest way would be to update the used NodeJS version to a recent LTS release in order to make use of the available prebuilt binaries. Otherwise you might try to update the global version of node-gyp to the latest release which already contains adjustments to work with Python 3.12 https://github.com/nodejs/gyp-next/pull/214.
Recent versions of Python dropped bundling distutils
by default, and broke a ton of software in the process.
If your setup can't be upgraded to one of the (100+!) prebuilt os/architecture/node combinations of better-sqlite3, try running
pip install setuptools
npm install better-sqlite3 --save
See more here: https://github.com/nodejs/node-gyp/issues/2915
Python: 3.12.2 installed.
I'm attempting to do a clean install into my Electron app in VSCode using the following command:
npm install better-sqlite3 --save
The install fails with the following stack:
According to my research,
distutils
is no longer supported/exported in Python 3.12.