Hi,
Can you do something like (and show me your result):
(@v1.9) pkg> st ScikitLearn Plots PyCall PythonCall
Status `~/.julia/environments/v1.9/Project.toml`
[91a5bcdd] Plots v1.38.10 `~/.julia/dev/Plots`
[438e738f] PyCall v1.95.1
[6099a3de] PythonCall v0.9.12
[3646fa90] ScikitLearn v0.7.0
I don’t know exactly what’s the problem for your environment (any version should work in theory), but I know that at least these combinations of versions work for me.
They are the latest for ScikitLearn, which relies on PyCall, also latest, and work for me:
julia> @time using PyCall
0.572052 seconds (396.61 k allocations: 24.870 MiB, 2.31% compilation time)
julia> @time using ScikitLearn
[ Info: Precompiling ScikitLearn [3646fa90-6ef7-5e7e-9f22-8aca16db6324]
78.669469 seconds (3.46 M allocations: 229.452 MiB, 0.19% gc time, 3.66% compilation time: 92% of which was recompilation)
julia> versioninfo()
Julia Version 1.9.0-rc1
Very likely should work for you on 1.8 too. I’m on Linux and PyCall is a bit different there, on Windows I know it downloads a version for you. I’m not sure if that’s part of the reason or it failed. In general I would use PythonCall instead of PyCall, but that’s out of your hands as the latter is a dependency of ScikitLearn.
I googled your problem, and found a slightly different error, still a precompile error, so worth to try:
https://github.com/cstjean/ScikitLearn.jl/issues/105#issuecomment-1001791572
I am not able to reproduce but did have a different issue that was resolved with
import Conda
Conda.update()
And sometimes the AI can (make code, or if not gets an error message can) figure errors out, so I got curious what it would say (and I pasted the error message in full, and just that in Bing Chat):
Searching for: Failed to precompile ScikitLearn [3646fa90-6ef7-5e7e-9f22-8aca16db6324]
Generating answers for you…
This error message is usually caused by a package that failed to precompile. The error message suggests that the ScikitLearn package failed to precompile. This could be due to a number of reasons such as missing dependencies or an outdated version of Julia. You can try updating your Julia version and then reinstalling the ScikitLearn package. If that doesn’t work, you can try removing the package and then reinstalling it again. Here is an example of how you can remove and reinstall the ScikitLearn package:
using Pkg
Pkg.rm("ScikitLearn")
Pkg.add("ScikitLearn")
I hope this helps!
I wasn’t too sure about that, but since I’m not having a problem, I can’t know for sure if this helps you, so I asked further:
Could it have to do with PyCall?
Searching for: PyCall ScikitLearn
Generating answers for you…
Yes, it could be related to PyCall. PyCall is a Julia package that allows you to call Python functions from Julia. ScikitLearn.jl uses PyCall to interface with the Scikit-Learn library in Python. If you are having issues with PyCall, it could be due to a number of reasons such as missing dependencies or an outdated version of Julia. You can try updating your Julia version and then reinstalling the PyCall package. If that doesn’t work, you can try removing the package and then reinstalling it again. Here is an example of how you can remove and reinstall the PyCall package:
using Pkg
Pkg.rm(“PyCall”)
Pkg.add(“PyCall”)
I hope this helps!