Hello,
I am rather new to the forums, and I came across an interesting error in Pumas while trying to fit a model:
import MLJScikitLearnInterface[ Info: Installing sklearn via the Conda scikit-learn package...
[ Info: Running `conda install -y scikit-learn` in root environment
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
ERROR: InitError: PyError (PyImport_ImportModule
The Python package sklearn could not be imported by pyimport. Usually this means
that you did not install sklearn in the Python version being used by PyCall.
PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package. To install the sklearn module, you can
use `pyimport_conda("sklearn", PKG)`, where PKG is the Anaconda
package that contains the module sklearn, or alternatively you can use the
Conda package directly (via `using Conda` followed by `Conda.add` etcetera).
Alternatively, if you want to use a different Python distribution on your
system, such as a system-wide Python (as opposed to the Julia-specific Python),
you can re-configure PyCall with that Python. As explained in the PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.
Here is the stack trace for reference:
[1] pyimport(name::String)
@ PyCall ~/data/.julia/packages/PyCall/7a7w0/src/PyCall.jl:550
[2] pyimport_conda(modulename::String, condapkg::String, channel::String)
@ PyCall ~/data/.julia/packages/PyCall/7a7w0/src/PyCall.jl:714
[3] pyimport_conda
@ ~/data/.julia/packages/PyCall/7a7w0/src/PyCall.jl:707 [inlined]
[4] import_sklearn()
@ ScikitLearn.Skcore ~/data/.julia/packages/ScikitLearn/ssekP/src/Skcore.jl:156
[5] __init__()
@ MLJScikitLearnInterface ~/data/.julia/packages/MLJScikitLearnInterface/I8FSe/src/MLJScikitLearnInterface.jl:11
[6] _include_from_serialized(path::String, depmods::Vector{Any})
@ Base ./loading.jl:768
[7] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
@ Base ./loading.jl:854
[8] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1097
[9] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:1013
[10] require(into::Module, mod::Symbol)
@ Base ./loading.jl:997
[11] eval
@ ./boot.jl:373 [inlined]
[12] eval(x::Expr)
@ Base.MainInclude ./client.jl:453
[13] _import(modl::Module, api_pkg::Symbol, pkg::Symbol, doprint::Bool)
@ MLJModels /builds/PumasAI/PumasSystemImages-jl/.julia/packages/MLJModels/ZryaP/src/loading.jl:34
[14] top-level scope
@ /builds/PumasAI/PumasSystemImages-jl/.julia/packages/MLJModels/ZryaP/src/loading.jl:206
during initialization of module MLJScikitLearnInterface
caused by: PyError (PyImport_ImportModule
If anyone has any suggestions I would greatly appreciate it!