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

Python SyntaxError: invalid syntax while trying to install #61

Closed
kvz opened this issue Mar 31, 2020 · 4 comments
Closed

Python SyntaxError: invalid syntax while trying to install #61

kvz opened this issue Mar 31, 2020 · 4 comments

Comments

@kvz
Copy link

kvz commented Mar 31, 2020

Here's what I got:

error /srv/current/api2/node_modules/re2: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /srv/current/api2/node_modules/re2
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@8.15.1 | linux | x64
gyp ERR! configure error 
gyp ERR! stack Error: Command failed: /home/ubuntu/.nix-profile/bin/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: invalid syntax
gyp ERR! stack 
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:281:12)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:915:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
gyp ERR! System Linux 4.15.0-1063-aws

My Python version:

$ /home/ubuntu/.nix-profile/bin/python --version
Python 3.7.0

Any idea how I could resolve this?

@kvz
Copy link
Author

kvz commented Mar 31, 2020

I guess this is not a re2 issue, but something with gyp only supporting python 2.7 nodejs/node-gyp#324

Edit: it seems fixed in nodejs/node-gyp#1534, which landed in gyp v4 it seems https://github.com/nodejs/node-gyp/blob/master/CHANGELOG.md#v400-2019-04-24

Will try upgrading node-gyp, sorry for the noise!

@kvz kvz closed this as completed Mar 31, 2020
@uhop
Copy link
Owner

uhop commented Apr 25, 2020

Added to the docs.

@kvz
Copy link
Author

kvz commented Apr 26, 2020

FWIW upgrading gyp did not work, what did work for us was installing python 2.7 and passing:

PYTHON=<location to python27> npm 

@uhop
Copy link
Owner

uhop commented Apr 26, 2020

Updated the docs with this information. Thank you!

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