Skip to content

embbed in c#,can't not import dotnet namespace of the host. #1489

Closed
@heartacker

Description

@heartacker

Environment

  • Pythonnet version:3.0.0-preview2021-06-04
  • Python version:3.7.9
  • Operating System:1607 64bit
  • .NET Runtime: donet core 3.1.408(64bit)

Details

  • Describe what you were trying to get done.

    embbed the Pythonnet to ATC.Studio wpf app, and after upgrade to pythonnet 3.0

    pythonnet can't not import the ATC.Studio, and it work when pythonnet is 2.5

  • What commands did you run to trigger this issue? If you can provide a
    Minimal, Complete, and Verifiable example
    this will help us understand the issue.

try
{
    Py.Import("ATC.Studio");
}
Message:	object is not a module
TypeName:	object is not a module
StackTrc:	   at Python.Runtime.PyScope..ctor(IntPtr ptr, PyScopeManager manager)
   at Python.Runtime.PyScope..ctor(NewReference& reference, PyScopeManager manager)
   at Python.Runtime.PyModule..ctor(NewReference& reference)
   at Python.Runtime.PyModule.Import(String name)
   at Python.Runtime.Py.Import(String name)
   at ATC.Studio.CodeStudio.ExecuteCode(String codestr, TestSettings settings, RunFlagType rflg, String filepath, Dictionary`2 psValue, PyDict locals) in F:\ATCProjectFiles\AutoTool_SVN\atcgui\ATC.Studio\CodeStudio.xaml.cs:line 683
Code end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions