File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -682,6 +682,23 @@ def notebook_modification_function(notebook_content, notebook_filename):
682
682
# imports inside functions
683
683
code_lines .extend (["import matplotlib" , "import pandas" ])
684
684
685
+ # Work around https://github.com/jupyterlite/pyodide-kernel/issues/166
686
+ # and https://github.com/pyodide/micropip/issues/223 by installing the
687
+ # dependencies first, and then scikit-learn from Anaconda.org.
688
+ if "dev" in release :
689
+ dev_docs_specific_code = [
690
+ "import piplite" ,
691
+ "import joblib" ,
692
+ "import threadpoolctl" ,
693
+ "import scipy" ,
694
+ "await piplite.install(\n "
695
+ f" 'scikit-learn=={ release } ',\n "
696
+ " index_urls='https://pypi.anaconda.org/scientific-python-nightly-wheels/simple',\n "
697
+ ")" ,
698
+ ]
699
+
700
+ code_lines .extend (dev_docs_specific_code )
701
+
685
702
if code_lines :
686
703
code_lines = ["# JupyterLite-specific code" ] + code_lines
687
704
code = "\n " .join (code_lines )
You can’t perform that action at this time.
0 commit comments