-
Notifications
You must be signed in to change notification settings - Fork 9
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
Building and testing Python packages out of tree for Python package with C++ code produces error saying a required module (numpy) is not found. #44
Comments
Thanks for the report @aya49! @ryanking13 is this potentially related to #21? |
From the paths it looks like you are using python3.10. Can you try again with Python 3.12? If that's the problem, we should add a version check with a sensible error message. |
I am guessing that it is more related to the Python version mismatch. |
We definitely should add a test that we return a good error when there is a version mismatch. |
We do check the version when installing the xbuildenv, but looking at the build log, for some reason it is already installed so there was no additional verification. |
Probably |
Yeah, I think we should
|
Thank you for the fast reply @hoodmane! I will try it out and post the results! Edit: It worked!! |
This adds a check when initializing xbuildenv (== `init_environment`) to make sure the local Python version used to install the xbuildenv was not changed. This prevents the following scenario: 1. One has a local Python version (3.11.3) and installs Pyodide xbuildenv (0.25.1). 2. Then, one changes the local Python version to (3.12.1) using pyenv. 3. Pyodide xbuildenv 0.25.1 is no longer compatible to the local Python version, so it should fail. Related issue: #44
🐛 Bug
I am in WSL2, trying to build a Python package (FlowUtils) out of tree for Pyodide because it has C++ scripts in the package: https://pyodide.org/en/stable/development/building-and-testing-packages.html#building-and-testing-packages-out-of-tree
After following the instructions in a virtual environment, I get into the Package directory and run
pyodide build
, it gives me an error saying that I don't havenumpy
, which I do.I also tried building the package normally, and it works. The website said if that's the case, then to open an issue, so here it is! Am I doing something wrong?
Note: I also tried building the package in the tree but it also fails when I try to build
pyodide build-recipes flowutils --install
, failing at the first package... that's out of scope here, but this is why I tried building out of tree: https://pyodide.org/en/stable/development/new-packages.htmlTo Reproduce
Pre-requisite: I've already installed Python packages
numpy
andpyodide-dev
. I also havepython3-dev
installed.In Windows 11 WSL2 Ubuntu 22.02 terminal:
Expected behavior
From the website:
"pyodide build invokes a slightly modified version of the pypa/build build frontend so the behavior should be similar to what happens if you do:"
"If you run into problems, make sure that building a native wheel with pypa/build works."
The packages builds normally when using pypa/build. But it shows and error when I use Pyodide's build (output below). I think the latter is suppose to build normally too but it doesn't.
Environment
Additional context
Error:
When building normally:
The text was updated successfully, but these errors were encountered: