The behavior of ScriptRuntime.ImportModule #1645
Answered
by
slozier
otogawakatsutoshi
asked this question in
Q&A
|
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) |
Answered by
slozier
Jan 9, 2023
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"); |
1 reply
Answer selected by
otogawakatsutoshi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are you missing paths to the standard library? For example: