Scikit-learn for Maya 2020

Hi Guys,

I needed to compile the a compatible version of scikit-learn with maya 2020, but I need help.
the latest version is not compatible with the Maya 2020 Python ( 2.7 )

I tried :

mayapy.exe -m pip install -U scikit-learn

But I have a error message ( python version not compatible or skikit-learn is not compiled )

And I tried too :

mayapy.exe pip2.7 install scikit-learn

But I get a error with my ENV PATH and pip2.7, so I need to check that.
If you have some ideas, please don’t hesitate …

To get that to work, you’d have to manually compile scikit with a different compiler (VS2017 for Windows, XCode 10.2.1 for Mac, GCC 6.3.1 for Linux), and that can be an incredibly painful process. If you can do what you want with just numpy, there are some pre-compiled numpy wheels that you can use if you’re on Windows. But I don’t know of any scikit ones out there (maybe someone else does?)
Also, I’m pretty sure in Maya 2022 with Python3, we can just use stuff from pypi, so IMO it’s really not worth it to go through the hassle of compiling.

If you have to use scikit though, then I would say you should just use subprocess and run a new plain-old python process outside of maya that does your scikit stuff.

Thanks tfox, you’re right, the solution was to launch maya 2022 with:

"C:\Program Files\Autodesk\Maya2022\bin\mayapy.exe" -m pip install --upgrade pip"
"C:\Program Files\Autodesk\Maya2022\bin\mayapy.exe" -m pip install --user scikit-learn

It’s works like a charm :wink:

So when you titled this topic Scikit-learn for Maya 2020, you meant Scikit-learn for Maya 2020 or 2022
:wink:

Either way, glad to help!

@skyrick ,if you happen to have it, can you by any chances share your compiled module of 2020(windows) ? I’m not techy enough to compile my own binaries

Sorry but I abandoned maya 2020 for 2022 on this problem.
I can’t change the topic to modify the title …