File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -682,6 +682,22 @@ 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 micropip" ,
691
+ "await micropip.install(['joblib', 'threadpoolctl', 'scipy'])" ,
692
+ "await micropip.install(\n "
693
+ " 'scikit-learn',\n "
694
+ " index_urls='https://pypi.anaconda.org/scientific-python-nightly-wheels/simple',\n "
695
+ " pre=True,\n "
696
+ ")" ,
697
+ ]
698
+
699
+ code_lines .extend (dev_docs_specific_code )
700
+
685
701
if code_lines :
686
702
code_lines = ["# JupyterLite-specific code" ] + code_lines
687
703
code = "\n " .join (code_lines )
You can’t perform that action at this time.
0 commit comments