Title: Exception with mysterious description while trying to initialize yt_dlp from C# · pythonnet/pythonnet · Discussion #2675 · GitHub
Open Graph Title: Exception with mysterious description while trying to initialize yt_dlp from C# · pythonnet/pythonnet · Discussion #2675
X Title: Exception with mysterious description while trying to initialize yt_dlp from C# · pythonnet/pythonnet · Discussion #2675
Description: Exception with mysterious description while trying to initialize yt_dlp from C#
Open Graph Description: I have a C# project from which I'm trying to experiment with calling yt-dlp. On the follow statement, I get an exception for which the message is that the exception was thrown. The exception's Inne...
X Description: I have a C# project from which I'm trying to experiment with calling yt-dlp. On the follow statement, I get an exception for which the message is that the exception was thrown. The exception...
Opengraph URL: https://github.com/pythonnet/pythonnet/discussions/2675
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Exception with mysterious description while trying to initialize yt_dlp from C#","text":"I have a C# project from which I'm trying to experiment with calling yt-dlp. On the follow statement, I get an exception for which the message is that the exception was thrown. The exception's InnerException is null. What could be going on?
\nException of type 'System.ExecutionEngineException' was thrown.\n
\n
\nI tried to step into the code, but quickly ran into unmanaged code before finding where the exception was thrown.
\nFatal error. 0xC0000005\n at Python.Runtime.Runtime.PyImport_ImportModule(System.String)\n at Python.Runtime.PyModule.Import(System.String)\n at Python.Runtime.Py.Import(System.String)\n at YtDlpTest.TestYtDlp..ctor()\n at DynamicClass.lambda_method172(System.Runtime.CompilerServices.Closure)\n at System.Management.Automation.CommandProcessor.Init(System.Management.Automation.CmdletInfo)\n at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(System.Management.Automation.CommandInfo, System.Management.Automation.CommandOrigin, System.Nullable`1<Boolean>, System.Management.Automation.SessionStateInternal)\n at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(System.String, System.Management.Automation.CommandOrigin, System.Nullable`1<Boolean>)\n at System.Management.Automation.ExecutionContext.CreateCommand(System.String, Boolean)\n at System.Management.Automation.PipelineOps.AddCommand(System.Management.Automation.Internal.PipelineProcessor, System.Management.Automation.CommandParameterInternal[], System.Management.Automation.Language.CommandBaseAst, System.Management.Automation.CommandRedirection[], System.Management.Automation.ExecutionContext)\n at System.Management.Automation.PipelineOps.InvokePipeline(System.Object, Boolean, System.Management.Automation.CommandParameterInternal[][], System.Management.Automation.Language.CommandBaseAst[], System.Management.Automation.CommandRedirection[][], System.Management.Automation.Language.FunctionContext)\n at System.Management.Automation.Interpreter.ActionCallInstruction`6[[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Boolean, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Run(System.Management.Automation.Interpreter.InterpretedFrame)\n at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)\n at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)\n at System.Management.Automation.Interpreter.Interpreter.Run(System.Management.Automation.Interpreter.InterpretedFrame)\n at System.Management.Automation.Interpreter.LightLambda.RunVoid1[[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon)\n at System.Management.Automation.DlrScriptCommandProcessor.RunClause(System.Action`1<System.Management.Automation.Language.FunctionContext>, System.Object, System.Object)\n at System.Management.Automation.DlrScriptCommandProcessor.Complete()\n at System.Management.Automation.CommandProcessorBase.DoComplete()\n at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(System.Management.Automation.CommandProcessorBase)\n at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(System.Object)\n at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()\n at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()\n at System.Management.Automation.Runspaces.PipelineThread.WorkerProc()\n at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)\n
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"Now I find out I have to use gil for even the import. The source I was following didn't mention that.
","upvoteCount":1,"url":"https://github.com/pythonnet/pythonnet/discussions/2675#discussioncomment-15399546"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:8df64022-79a2-475b-4f30-b7e96aa7f56e |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | 8798:2AE294:18FC98E:21C7A07:69701972 |
| html-safe-nonce | fe59d6e77d1849920a617855e1590b6ca3963983b6d967f694e4f07a47023d93 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Nzk4OjJBRTI5NDoxOEZDOThFOjIxQzdBMDc6Njk3MDE5NzIiLCJ2aXNpdG9yX2lkIjoiNDQ5MTA4ODQ2NjcxNTYxMzU1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 591b06f53b7e1f8c0d9a51701af38f55288c17ea6fb012f2ff11f6ac3ef9cf8d |
| hovercard-subject-tag | discussion:9287581 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/pythonnet/pythonnet/2675/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/7d6e33883cf636a3ab36bf7cd0744e2c72baca435c7c18364f85de6effd72917/pythonnet/pythonnet/discussions/2675 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7d6e33883cf636a3ab36bf7cd0744e2c72baca435c7c18364f85de6effd72917/pythonnet/pythonnet/discussions/2675 |
| og:image:alt | I have a C# project from which I'm trying to experiment with calling yt-dlp. On the follow statement, I get an exception for which the message is that the exception was thrown. The exception's Inne... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043a09521e81f00c45482046b3f38390b8b292cf9a86ad665a632633a072c05c |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 98881eadf8ae73000970c42161c094b0809b1330 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width