Skip to content

Make psutil optional in emscripten platform - #269

Merged
vstinner merged 1 commit into
psf:mainfrom
ryanking13:psutil-optional
Nov 3, 2026
Merged

vstinner merged 1 commit into
psf:mainfrom
ryanking13:psutil-optional

Conversation

@ryanking13

Copy link
Copy Markdown
Contributor

Follow up of #234

psutil doesn't (and never) work in emscripten since it requires hardware access, so disabling it so that installing pyperf do not fail on emscripten platforms.

@vstinner

vstinner commented Nov 3, 2026

Copy link
Copy Markdown
Member

Can you post the traceback/error message that you get?

@ryanking13

Copy link
Copy Markdown
Contributor Author

Can you post the traceback/error message that you get?

Do you mean when installing pyperf on emscripten? Here is what I get using uv's emscripten build which uses Pyodide in the backend.

$ uv venv --python pyodide-3.14.2-emscripten-wasm32-musl
$ uv pip install pyperf

error: Failed to build `psutil==7.2.2`                                                                                                                                                                                                           cause: The build backend returned an error
  cause: Call to `setuptools.build_meta.get_requires_for_build_wheel` failed (exit status: 1)

         [stderr]
         platform emscripten is not supported

hint: `psutil` (v7.2.2) was included because `pyperf` (v2.10.0) depends on `psutil`

hint: Build failures usually indicate a problem with the package or the build environment

@vstinner

vstinner commented Nov 3, 2026

Copy link
Copy Markdown
Member

Oh ok, the error message comes from psutil setup.py: https://github.com/giampaolo/psutil/blob/c7e6eb945a525f57c3843284e8f66ef4701af02c/setup.py#L368.

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vstinner
vstinner merged commit 57f50c0 into psf:main Nov 3, 2026
14 checks passed
@vstinner

vstinner commented Nov 3, 2026

Copy link
Copy Markdown
Member

Merged, thanks for the fix.

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

Successfully merging this pull request may close these issues.

2 participants