Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Import does not work from Cython #1890

Copy link
Copy link
@josephernest

Description

@josephernest
Issue body actions

This code works from Python:

import clr
clr.AddReference("abc.dll")
from ABC import abc

But when compiled with Cython --embed, it fails:

cython test.py --embed
call vcvarsallbat x64
cl test.c /I C:\Python38\include /link C:\Python38\libs\python38.lib
test.exe

with:

Traceback (most recent call last):
File "test.py", line 3, in init test
ModuleNotFoundError: No module named 'ABC'

Is this related to #941?

Is there a temporary or permanent fix for this?
Thanks!

A good idea would be to have an import function that can be called on clr namespace:

import clr
clr.AddReference("abc.dll")
ABC = clr.ImportModule('ABC')

that would not need to use the overridden import built-in function.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.