Skip to content

ImportError undefined symbol: _Py_Dealloc #122

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

Closed
initbar opened this issue Jan 23, 2018 · 4 comments
Closed

ImportError undefined symbol: _Py_Dealloc #122

initbar opened this issue Jan 23, 2018 · 4 comments

Comments

@initbar
Copy link

initbar commented Jan 23, 2018

Hello ~ I'm trying to learn the interface between Rust and Python - but I can't find the solution as to why I can't seem to import my compiled library (even using the code from the rust example).

The below build is from blaze:

screenshot

If there are any pointers (or a section in a documentation) where I can read and try to figure out the answer, I would appreciate the help 😃

@initbar
Copy link
Author

initbar commented Jan 23, 2018

@dgrunwald I've read the comment in issue #87, and realized that cargo was building against the Python 3 libraries. In that case, is it possible to provide flags to cargo build in such ways that both Python 2.7+ and Python 3.+ are supported?

@initbar
Copy link
Author

initbar commented Jan 23, 2018

Figured it out ~

[dependencies.cpython]
version = "0.1"

# Python 2.7
default-features = false
features = ["extension-module-2-7", "python27-sys"]

# Python 3+
# features = "extension-module"

@initbar initbar closed this as completed Jan 23, 2018
@ssokolow
Copy link

You could also plumb those into a feature in your own package so building for Python 2.x would be as simple as cargo build --no-default-features --features py27

@alantrick
Copy link

It might be good to mention this in the readme. I ran into this issue as well, and it was a little confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants