The behavior of ScriptRuntime.ImportModule #1645
-
When I try to import youtube-dl with ScriptRuntime.ImportModule using the ironPython3 librar at nuget.org, I get the error "IronPython.Runtime.Exceptions.ImportException : ImportException : No module named 'codecs'" error. However, when I import youtube-dl using ironpython3 with interactive expression, no error occurs. Is there a difference in behavior between ScriptRuntime.ImportModule and interactive import? The assumption is that I have removed the line where "from __future__" is used to make youtube-dl work with ironpython3. Translated with www.DeepL.com/Translator (free version) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Are you missing paths to the standard library? For example: var engine = Python.CreateEngine();
var paths = engine.GetSearchPaths();
paths.Add(@"C:\Program Files\IronPython 3.4\Lib");
paths.Add(@"C:\Program Files\IronPython 3.4\Lib\site-packages"); // change this to be where you installed youtube-dl
engine.SetSearchPaths(paths);
engine.ImportModule("youtube_dl"); |
Beta Was this translation helpful? Give feedback.
Are you missing paths to the standard library? For example: