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

Document: Node LTS (v20) and python 3.12 does not work on MarkBind install #2496

Open
kaixin-hc opened this issue Apr 4, 2024 · 4 comments

Comments

@kaixin-hc
Copy link
Contributor

Please confirm that you have searched existing issues in the repo

Yes, I have searched the existing issues

Any related issues?

No response

Tell us about your environment

M2 Mac v13.6.6

MarkBind version

5.4.0

Describe the bug and the steps to reproduce it

When running npm install in the root of markbind, see the following error:
node-gyp error

This error is caused because 3.12 python deprecates distutils, and node-gyp packaged with LTS is a node-gyp version before version 10. As stated in this issue, python 3.12 needs the newer version of node-gyp. It seems non trivial to update node-gyp version, as the official instructions here did not work for me (needs more testing).

However, one workaround that worked for me was adding the following line to node config
python=path/to/python/on/my/device and downgrading my python version (brew uninstall python@3.12 - though i had to force uninstall it due to dependencies)

(I also had to delete and reclone my MarkBind, but I suspect that was unrelated)

Expected behavior

If the versions are not supported, we should maybe warn users of the problem since right now we just say the following about required version...
Screenshot 2024-04-04 at 4 34 54 PM

Anything else?

Thank you @lhw-1 and @EltonGohJH for your extensive help troubleshooting this issue!

@yiwen101
Copy link
Contributor

yiwen101 commented Apr 8, 2024

I also run into the same issue this morning;

The cause is that "distutils package is removed in python version 3.12"

@jingting1412
Copy link
Contributor

jingting1412 commented Apr 8, 2024

I've also faced this issue before and this helped: https://stackoverflow.com/questions/77251296/distutils-not-found-when-running-npm-install , if many people also encounter the same issue as me maybe it'll be good to add a note in the devdocs regarding this

@yiwen101
Copy link
Contributor

yiwen101 commented Apr 8, 2024

I've also faced this issue before and this helped: https://stackoverflow.com/questions/77251296/distutils-not-found-when-running-npm-install , if many people also encounter the same issue as me maybe it'll be good to add a note in the devdocs regarding this

Thank you for the valuable input!

Additional note: For system with python3 installed via brew, running brew install python-setuptools can also solve the issue. Running python3 -m pip install setuptools may run intoerror: externally-managed-environment

@kaixin-hc
Copy link
Contributor Author

As this is now linked in our documentation, lets leave this open until we can remove the warning from our documentation.

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

No branches or pull requests

4 participants