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 3.11 and npm 6 (Node.js 14.x) does not support rebuilding from source #19

Open
mmomtchev opened this issue Nov 11, 2022 · 2 comments
Labels
wontfix This will not be worked on

Comments

@mmomtchev
Copy link
Owner

mmomtchev commented Nov 11, 2022

pymport cannot be rebuilt from source with Python 3.11 and npm 6.

Old versions of node-gyp are not compatible with Python 3.11.

nodejs/node-gyp#2219

There is no solution to this problem except to upgrade npm

The error message is:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/node/14.20.1/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
    sys.exit(gyp.script_main())
             ^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/node/14.[20](https://github.com/mmomtchev/pymport/actions/runs/3446910836/jobs/5753009688#step:7:21).1/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
    return main(sys.argv[1:])
           ^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/node/14.20.1/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
           ^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/node/14.20.1/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 520, in gyp_main
    [generator, flat_list, targets, data] = Load(
                                            ^^^^^
  File "/opt/hostedtoolcache/node/14.20.1/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 136, in Load
    result = gyp.input.Load(build_files, default_variables, includes[:],
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/node/14.20.1/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2782, in Load
    LoadTargetBuildFile(build_file, data, aux_data,
  File "/opt/hostedtoolcache/node/14.20.1/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile
    build_file_data = LoadOneBuildFile(build_file_path, data, aux_data,
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/node/14.20.1/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 234, 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 (/opt/hostedtoolcache/node/14.20.1/x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Linux 5.15.0-10[22](https://github.com/mmomtchev/pymport/actions/runs/3446910836/jobs/5753009688#step:7:23)-azure
@mmomtchev mmomtchev added the wontfix This will not be worked on label Nov 11, 2022
@cclauss
Copy link
Contributor

cclauss commented Dec 17, 2022

The U file mode was removed in Python 3.11 because it had no effect so the U can merely be removed.

Why use npm 6 when npm 9.2 is available?

@mmomtchev
Copy link
Owner Author

This is exactly why this issue has a wontfix label - if you have npm 6 and Python 3.11 you cannot build pymport and the only solution that makes any sense is to upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants