Commit 9a80a71
committed
Build: Report actionable error during pip install if npm is not installed
The error now displays like this:
Building wheels for collected packages: pminit
Building wheel for pminit (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pminit (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [38 lines of output]
PythonMonkey Build Error:
* It appears npm is not installed on this system.
* npm is required for PythonMonkey to build.
* Please install NPM and Node.js before installing PythonMonkey.
* Refer to the documentation for installing NPM and Node.js here: https://nodejs.org/en/download
Traceback (most recent call last):
File "/tmp/pip-req-build-75mp6ch1/post-install-hook.py", line 38, in <module>
main()
File "/tmp/pip-req-build-75mp6ch1/post-install-hook.py", line 33, in main
raise Exception("PythonMonkey build error: Unable to find npm on the system.")
Exception: PythonMonkey build error: Unable to find npm on the system.
Traceback (most recent call last):
File "/home/will/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/will/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/will/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/tmp/pip-build-env-emge0d96/overlay/local/lib/python3.10/dist-packages/poetry/core/masonry/api.py", line 57, in build_wheel
return WheelBuilder.make_in(
File "/tmp/pip-build-env-emge0d96/overlay/local/lib/python3.10/dist-packages/poetry/core/masonry/builders/wheel.py", line 88, in make_in
wb.build(target_dir=directory)
File "/tmp/pip-build-env-emge0d96/overlay/local/lib/python3.10/dist-packages/poetry/core/masonry/builders/wheel.py", line 123, in build
self._build(zip_file)
File "/tmp/pip-build-env-emge0d96/overlay/local/lib/python3.10/dist-packages/poetry/core/masonry/builders/wheel.py", line 172, in _build
self._run_build_script(self._package.build_script)
File "/tmp/pip-build-env-emge0d96/overlay/local/lib/python3.10/dist-packages/poetry/core/masonry/builders/wheel.py", line 232, in _run_build_script
subprocess.check_call([self.executable.as_posix(), build_script])
File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', 'post-install-hook.py']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pminit
Failed to build pminit
ERROR: Could not build wheels for pminit, which is required to install pyproject.toml-based projects1 parent ae133ef commit 9a80a71
1 file changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
18 | 36 | | |
19 | 37 | | |
20 | 38 | | |
| 39 | + | |
0 commit comments