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

Linux .so C-Extension works when importing functions into python; however, Mac OS X fails to import functions (i.e. import errors) #2907

DaddyGrimmlin opened this Issue Mar 28, 2019 · 2 comments


None yet
2 participants
Copy link

commented Mar 28, 2019

Using Python 3.6
Mac OS X Mojave

The C-extension was originally created on Linux machine and it works properly when importing it into another project. File Structure:

c_ext/  <- imports functions from  <- from .c_ext import <func>

When executing the build_ext on Mac to create a mac binary the python_func is not able to import functions from the resultant binary.


This comment has been minimized.

Copy link

commented Mar 30, 2019

Do I see it correctly that python_func is not part of the c_ext package but tries to use a relative import? That can't work.


This comment has been minimized.

Copy link

commented Mar 30, 2019

They are nested together under a parent package.


This works in Linux. I import the functions in the c_ext in the peer, then in I do from c_ext import python_func. If this is not the proper way to use a function defined in a c extension in python, then what is the proper way?

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