question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

passing python2.7 path doesnot have effect

See original GitHub issue

Hello, i have encountered a very annoying issue. The only workaround i have is to symlink python2.7 to python, which ofcourse breakes a lot of other programs on my system.

[shalva@archLinux loadCell2]$ cd node_modules/@serialport/bindings/ [shalva@archLinux bindings]$ ls binding.gyp build CHANGELOG.md lib LICENSE package.json README.md src [shalva@archLinux bindings]$ nw-gyp configure --target=0.33.0 --python /usr/bin/python2.7 gyp info it worked if it ends with ok gyp info using nw-gyp@3.6.3 gyp info using node@10.10.0 | linux | x64 gyp info spawn /usr/bin/python2.7 gyp info spawn args [ ‘/usr/lib/node_modules/nw-gyp/gyp/gyp_main.py’, gyp info spawn args ‘binding.gyp’, gyp info spawn args ‘-f’, gyp info spawn args ‘make’, gyp info spawn args ‘-I’, gyp info spawn args ‘/home/shalva/Projects/WebstormProjects/loadCell2/node_modules/@serialport/bindings/build/config.gypi’, gyp info spawn args ‘-I’, gyp info spawn args ‘/usr/lib/node_modules/nw-gyp/addon.gypi’, gyp info spawn args ‘-I’, gyp info spawn args ‘/home/shalva/.nw-gyp/0.33.0/common.gypi’, gyp info spawn args ‘-Dlibrary=shared_library’, gyp info spawn args ‘-Dvisibility=default’, gyp info spawn args ‘-Dnode_root_dir=/home/shalva/.nw-gyp/0.33.0’, gyp info spawn args ‘-Dnode_gyp_dir=/usr/lib/node_modules/nw-gyp’, gyp info spawn args ‘-Dnode_lib_file=“/home/shalva/.nw-gyp/0.33.0/<(target_arch)/node.lib”’, gyp info spawn args ‘-Dnw_lib_file=“/home/shalva/.nw-gyp/0.33.0/<(target_arch)/nw.lib”’, gyp info spawn args ‘-Dmodule_root_dir=/home/shalva/Projects/WebstormProjects/loadCell2/node_modules/@serialport/bindings’, gyp info spawn args ‘-Dnode_engine=v8’, gyp info spawn args ‘–depth=.’, gyp info spawn args ‘–no-parallel’, gyp info spawn args ‘-Dv13=1’, gyp info spawn args ‘–generator-output’, gyp info spawn args ‘build’, gyp info spawn args ‘-Goutput_dir=.’ ] File “<string>”, line 1 import sys; print sys.byteorder ^ SyntaxError: invalid syntax gyp: Call to ‘python -c “import sys; print sys.byteorder”’ returned exit status 1 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/nw-gyp/lib/configure.js:359:16) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12) gyp ERR! System Linux 4.18.6-arch1-1-ARCH gyp ERR! command “/usr/bin/node” “/usr/bin/nw-gyp” “configure” “–target=0.33.0” “–python” “/usr/bin/python2.7” gyp ERR! cwd /home/shalva/Projects/WebstormProjects/loadCell2/node_modules/@serialport/bindings gyp ERR! node -v v10.10.0 gyp ERR! nw-gyp -v v3.6.3 gyp ERR! not ok [shalva@archLinux bindings]$

it seems that there is hardcoded "python -c “import sys; print sys.byteorder” command…

P.S. this is my first issue on gihub so i wonder why code tag removes new lines? writing without it seems to be better…

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
corwin-of-ambercommented, Dec 12, 2020

In Node, the issue has been patched two years ago by: https://github.com/nodejs/node/commit/3d8b844112bf6526ce126ecaec85f83b31a0a9aa

I could not quite find there the .gypi files are taken from to create the NWjs release files. Should maybe ask @TheJaredWilcurt.

0reactions
corwin-of-ambercommented, Dec 21, 2020

I am using a different workaround until nwjs/node#46 is (hopefully) fixed: edit ~/.nw-gyp/0.49.2/config.gypi (replace 0.49.2 with your NWjs version) and change the offending print sys.byteorder to print(sys.byteorder).

Notice that this directory is only created after you have run nw-gyp for the first time with a given --target.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding Python to PATH on Windows - Stack Overflow
Hold Win and press Pause . Click Advanced System Settings. Click Environment Variables. Append ;C:\python27 to the Path variable. Restart Command Prompt.
Read more >
Options available to all runners — mrjob v0.7.4 documentation
Options that take multiple values can be passed multiple times on the command line. All options can be passed as keyword arguments to...
Read more >
Robot Framework User Guide
If you are editing user variables and PATH does not exist, click New instead. ... Start a new command prompt for the changes...
Read more >
When Things Go Wrong — PyInstaller 5.7.0 documentation
Examine the warning file; often there will be dozens of modules not found, but their absence has no effect. When you run the...
Read more >
unittest.mock — mock object library — Python 3.11.1 ...
Attempting to access attributes or methods on the mock that don't exist on the ... When you nest patch decorators the mocks are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found