Julia Pkg.add from python script

Viewed 50

I have a julia function:

def some_function():
 model = RandomForestRegressor(max_depth=10)
 .
 .
 .
 return predictions
end

and a python function:

def py_function():
 predictions = Main.some_function()
 return predictions

The problem is simplified obviously, but that returns an error:

JuliaError: Exception 'ArgumentError: Package RandomForest not found in current path:
- Run `import Pkg; Pkg.add("RandomForest")` to install the RandomForest package.
' occurred while calling julia code:
using RandomForest

I conclude that julia enviroment doesn't have the RandomForest module. How can I add it from a my_file.py level?

1 Answers
>>> from julia import Pkg
>>> Pkg.add("RandomForest")
Related