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

Hidden build dependency on Python 2 #35

Open
mferber opened this issue Jun 22, 2022 · 1 comment
Open

Hidden build dependency on Python 2 #35

mferber opened this issue Jun 22, 2022 · 1 comment

Comments

@mferber
Copy link

mferber commented Jun 22, 2022

A dependency of this project (xpc-connect) seems to be dependent on Python 2 to build, which is a problem on macOS now that Python isn't bundled with the OS anymore. This is in no way bleno's problem, but it would be helpful to add it to the Mac installation instructions.

It works for me when Python 2 is installed with pyenv and either python or python2 points to it. Also possible that upgrading the xpc-connect dependency might solve the problem, as it has a recent commit related to Mac versions (though not obviously having anything to do with Python).

With only Python 3 installed, npm install produces the following.

Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: ...
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/xxx/.pyenv/shims/python -c import sys; print \"%s.%s.%s\" % sys.version_info[:3];
gyp ERR! stack   File \"<string>\", line 1
gyp ERR! stack     import sys; print \"%s.%s.%s\" % sys.version_info[:3];
gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:389:12)
gyp ERR! stack     at ChildProcess.emit (node:events:537:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
gyp ERR! stack     at Socket.<anonymous> (node:internal/child_process:449:11)
gyp ERR! stack     at Socket.emit (node:events:537:28)
gyp ERR! stack     at Pipe.<anonymous> (node:net:747:14)
gyp ERR! System Darwin 21.5.0
@RamlahAziz
Copy link

For anyone else facing this in windows - I changed the default python of my system to python2.7 and pointed all environment variables to python2.7 too, but npm install @abandonware/bleno still would pick up python 3.9 and cause the above error.
What worked for me was downgrading from node 16.2.0 to 14.17.1 using nvm, and then it installed. I've given a detailed description here

This isn't a solution though - just a workaround until the dependency is fixed.

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