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

Clarify that the latest Python might not work #2767

Closed
wants to merge 1 commit into from
Closed

Clarify that the latest Python might not work #2767

wants to merge 1 commit into from

Conversation

Nantris
Copy link

@Nantris Nantris commented Nov 30, 2022

I wasted a lot of time not realizing Python 3.11 isn't supported because of the lack of clarity in the line I've edited.

Checklist
Description of change

Remove unclear reference to "current" Python version, that does not necessarily mean "current."

Someone please let me know if I need to re-title my PR. I don't see the relevant prefix, but maybe "docs:" ?

I wasted a lot of time not realizing Python 3.11 isn't supported because of the lack of clarity in the line I've edited.
@Nantris
Copy link
Author

Nantris commented Nov 30, 2022

Actually, I get the same error no matter what version of Python 3 I use. Why is that? Isn't this issue supposed to be fixed already?

#2219

@cclauss
Copy link
Contributor

cclauss commented Nov 30, 2022

As stated above, the problem was not related to the Python 3 version. This change is not needed because we work with and test pre-release versions of Python to ensure that our installation process is compatible with them on the day that they are released.

ur"strings" are incompatible with all versions of Python 3. If your binding.gyp file contains a ur"string" then please change it to an u"string". If this is not the case, then #2219 happens because an old version of node-gyp is being used.

Please look thru your error log for the string gyp info using node-gyp@ and if the version number is less than the current release of node-gyp then please upgrade using the instructions at https://github.com/nodejs/node-gyp/blob/master/docs/Updating-npm-bundled-node-gyp.md and try your command again.

@cclauss cclauss closed this Nov 30, 2022
@cclauss cclauss added the ERR! node-gyp -v < v10.x.x npm install -g npm label Nov 30, 2022
@Nantris
Copy link
Author

Nantris commented Nov 30, 2022

@cclauss I looked through the 8 binding.gyp files in our node_modules and none of them appear to specify rU or Ur, and node-gyp is at 9.3.0 which is the latest as of today.

I used Python2.7 to get around this, but I don't understand why the issue is occurring.

Please look thru your error log for the string gyp info using node-gyp@

Can you clarify what you mean by "your error log"? What would this be on a Windows machine? I don't see an npm-debug.log and there doesn't appear to be anything in Event Viewer (not that I expected there would be.)

@Nantris Nantris deleted the patch-1 branch November 30, 2022 23:42
@cclauss
Copy link
Contributor

cclauss commented Dec 1, 2022

  1. What command did you type?
  2. What text appeared on your screen after you typed it?

Python 2 died 1,065 days ago on 1/1/2020 os it should no longer be used.

@Nantris
Copy link
Author

Nantris commented Dec 2, 2022

Well, I just realize that node-gyp is installed locally in our node_modules, and that one is not the latest version - so I guess that's the issue.

The failing module was fibers, which our upcoming version doesn't rely on at all - so I guess this is moot. It also explicitly says it's incompatible with Node 16, which I didn't know.

Thanks very much for your help @cclauss!

In case you still had some interest in the output upon failure, here it is. The command we ran was just yarn.

error C:\Projects\MyProject\node_modules\fibers: Command failed.
Exit code: 1
Command: node build.js || nodejs build.js
Arguments:
Directory: C:\Projects\MyProject\node_modules\fibers
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@16.18.0 | win32 | x64
gyp info find Python using Python version 3.11.0 found at "C:\Python311\python.exe"
gyp info find VS using VS2019 (16.11.33027.164) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
gyp info find VS run with --verbose for detailed information
(node:5036) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn C:\Python311\python.exe
gyp info spawn args [
gyp info spawn args   'C:\\Projects\\MyProject\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Projects\\MyProject\\node_modules\\fibers\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Projects\\MyProject\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Me\\AppData\\Local\\node-gyp\\Cache\\16.18.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Me\\AppData\\Local\\node-gyp\\Cache\\16.18.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Projects\\MyProject\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\Me\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.18.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Projects\\MyProject\\node_modules\\fibers',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Projects\\MyProject\\node_modules\\fibers\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
Traceback (most recent call last):
  File "C:\Projects\MyProject\node_modules\node-gyp\gyp\gyp_main.py", line 51, in <module>
    sys.exit(gyp.script_main())
             ^^^^^^^^^^^^^^^^^
  File "C:\Projects\MyProject\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 670, in script_main
    return main(sys.argv[1:])
           ^^^^^^^^^^^^^^^^^^
  File "C:\Projects\MyProject\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 662, in main
    return gyp_main(args)
           ^^^^^^^^^^^^^^
  File "C:\Projects\MyProject\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 629, in gyp_main
    [generator, flat_list, targets, data] = Load(
                                            ^^^^^
  File "C:\Projects\MyProject\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 150, in Load
    result = gyp.input.Load(
             ^^^^^^^^^^^^^^^
  File "C:\Projects\MyProject\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 3021, in Load
    LoadTargetBuildFile(
  File "C:\Projects\MyProject\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 411, in LoadTargetBuildFile
    build_file_data = LoadOneBuildFile(
                      ^^^^^^^^^^^^^^^^^
  File "C:\Projects\MyProject\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 239, in LoadOneBuildFile
    build_file_contents = open(build_file_path, "rU").read()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'rU' 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 (C:\Projects\MyProject\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Windows_NT 10.0.22000
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Projects\\MyProject\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
gyp ERR! cwd C:\Projects\MyProject\node_modules\fibers
gyp ERR! node -v v16.18.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'`

@cclauss
Copy link
Contributor

cclauss commented Dec 2, 2022

Line 8:

gyp info using node-gyp@7.1.2

https://github.com/nodejs/node-gyp/releases

@Nantris
Copy link
Author

Nantris commented Dec 2, 2022

Yeah I realized, I mentioned - but I'm sure you're very busy and I know I'm a bit wordy. I appreciate all your help. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ERR! node-gyp -v < v10.x.x npm install -g npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants