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

Issue with ValX dependency: scikit-learn installation. #1

Closed
Infinitode opened this issue Nov 27, 2024 · 1 comment
Closed

Issue with ValX dependency: scikit-learn installation. #1

Infinitode opened this issue Nov 27, 2024 · 1 comment
Assignees
Labels
related-issue Related to ValX, but not caused by it.

Comments

@Infinitode
Copy link
Owner

Issue with ValX dependency: scikit-learn installation.

This issue is related to the installation of ValX, but not caused by ValX's code.

What happened?

Due to no prebuilt distributions for scikit-learn, ValX fails to install scikit-learn and tries to compile sklearn's package code from source. This raises an error during installation due to OpenMP compilation errors, especially on macOS.

Solution

Why this happens

If you go to PYPI and look at supporting scikit-learn versions for your platform, prebuilt wheels are usually for lower versions of Python (3.11 and lower). They are more often than not, rather specific to your platform. This is why pip then tries to build from source, since no matching pre-compiled wheels were found.

1. Build from source

You can work from source and build, compile, and install scikit-learn, before installing valx.

Warning

When building from source, follow scikit-learn's official documentation to avoid errors during compilation.

2. Use a prebuilt wheel

You can change your version of Python to one supported by the scikit-learn version you want to use. Check which version supports the platform and the Python version you are running. You can do this by going to: https://pypi.org/project/scikit-learn/#files.

You'll notice that the filename looks something like this:
scikit_learn-1.5.2-cp313-cp313-macosx_12_0_arm64.whl

This filename states that this prebuilt wheel is scikit_learn version 1.5.2 for Python 3.13 and macOS 12.0 arm64.

Note

There are other workarounds to resolve this issue, such as trying to disable OpenMP during the installation of scikit-learn, but this will disable OpenMP parallelism in scikit-learn.

@Infinitode Infinitode added the related-issue Related to ValX, but not caused by it. label Nov 27, 2024
@Infinitode Infinitode self-assigned this Nov 27, 2024
@Infinitode Infinitode pinned this issue Nov 27, 2024
@Infinitode
Copy link
Owner Author

ValX 0.2.4 now includes automatic model selection based on the scikit-learn version you have installed. This solves compatibility issues with scikit-learn 1.3.0 and later.

Important

If you are using scikit-learn 1.3.0 or later:

  • You can keep using numpy 2.x.

If you are using scikit-learn versions older than 1.3.0:

  • You must also downgrade your numpy 2.x to an older numpy 1.x version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
related-issue Related to ValX, but not caused by it.
Projects
None yet
Development

No branches or pull requests

1 participant