Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cythonized code cannot find system assemblies #3084

crayxt opened this issue Aug 19, 2019 · 1 comment


Copy link

commented Aug 19, 2019

Cross-post from pythonnet/pythonnet#941

Dup of my SO question

When I compile the python code which uses to access .Net assemblies, it can't find those assemblies. Without compilation it works ok.

For demo code, I used

My file

from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize

ext_modules = [
        sources = [''],
        language = 'c++'

  name = 'helloform',
  ext_modules = cythonize(ext_modules),

Then I build it with python build_ext --inplace.

I wanted to load compiled module from Python prompt with import helloform but it failed with

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "", line 8, in init helloform
ModuleNotFoundError: No module named 'System'

This comment has been minimized.

Copy link

commented Aug 19, 2019

This is dotnet specific code, using dotnet specific packages. What Python runtime do you use? Please ask over there what the problem might be. It's more likely that they would be able to resolve this than Cython.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.