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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Building and testing Python packages out of tree" commands need some dev tools installed as prerequisites #4692

Open
Indavelopers opened this issue Apr 12, 2024 · 3 comments

Comments

@Indavelopers
Copy link

馃摎 Documentation

In this step:
"PYODIDE_EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)"
It fails as needs files python.h and ffi.h

The solution is to previously install the following OS packages: python3-dev (or python3.X-dev), libffi-dev
You also have to install these packages before creating a venv, or recreating it

Please include this step as a prerequisite.
Will try to do it myself and submit a PR if I find time the next weeks

@ryanking13
Copy link
Member

Sure, please open a PR.

It fails as needs files python.h and ffi.h

Could you please attach the error you get? So we can make sure it is happening because python3-dev and libffi-dev is not installed.

@Indavelopers
Copy link
Author

Welp, I found this problem and needed to solve it in the way I indicated, installing python3-dev and libffi-dev, I'm pretty sure.

Unfortunately, I'm unable to reproduce this, as I see in every of my environments, once you have Python and Pip rolling, you finally find these libraries have been installed as dependencies, for example by Python3-pip if I recall correctly.
Last check was done on a clean Debian 12 Bookworm installation.
I also found that XZ is also needed, sorry don't recall right now if for:

PYODIDE_EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)
./emsdk install ${PYODIDE_EMSCRIPTEN_VERSION}

How would you recommend addressing this? How can I be of better help?
Should I add a PR stating a list of requirements at the start of the tutorial?
Or should we leave this just as an issue, as the probabilities it would come back again are low?

It fails as needs files python.h and ffi.h

Could you please attach the error you get? So we can make sure it is happening because python3-dev and libffi-dev is not installed.

Unfortunately, can't reproduce, but can confirm there were 2 errors: first one stated that "python.h file was not found", and I was able to research and find that python3-dev was needed, which solved it, and second one stated "ffi.h file was not found", which corresponded to libffi-dev not installed.

@ryanking13
Copy link
Member

I suspect that the error you are experiencing is caused by installing certain python packages that are required during the pyodide build environment installation process. More specifically, I think python.h or libffi was required because you're building those packages from source, but I believe that those packages can be installed using whl files without building from source.

So that's why I asked for a reproduction, to see on which environment the error happens. I guess this issue (#4347 (comment)) was happened because of the similar reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants