Skip to content

Importing python modules from C# #1952

@whitmell

Description

@whitmell

Environment

  • Pythonnet version: 2.5.2
  • Python version: 3.10
  • Operating System: Windows
  • .NET Runtime: 6.0

Details

  • Describe what you were trying to get done.

    Import a python module with an alias and call functions on this alias. Rather than execute a single string, I'd like to import the
    module in C# and use the resulting PyObject to call functions. Ex:

     from nltk.corpus import wordnet as wn
     ....
     wn.synsets('dog')
   
  • What commands did you run to trigger this issue? If you can provide a
    Py.Import("nltk.corpus.wordnet") <-- 'ModuleNotFoundError : No module named 'nltk.corpus.wordnet''
    from nltk.corpus import wordnet as wn
     ....
    wn.synsets('dog')
  • If there was a crash, please include the traceback here.
    print('TODO')

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