Skip to content

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

@Infinitode

Description

@Infinitode

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.

Metadata

Metadata

Assignees

Labels

related-issueRelated to ValX, but not caused by it.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions