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

Allow CODON_PYTHON to point to executable rather than library #591

Closed
orent opened this issue Sep 19, 2024 · 2 comments
Closed

Allow CODON_PYTHON to point to executable rather than library #591

orent opened this issue Sep 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@orent
Copy link

orent commented Sep 19, 2024

If dlopen(CODON_PYTHON) fails and the dlerror() string contains 'executable' it means it is pointing to an executable rather than a library.

So run this executable it with arguments '-m', 'sysconfig', search the output for a line containing LDLIBRARY, take the value after the '=' and use that instead.

@inumanag inumanag added the enhancement New feature or request label Sep 23, 2024
@inumanag
Copy link
Contributor

Hi @orent

Do you mind clarifying this? Not all Python executables ship with a dynamic library, hence that would not be the best solution at the moment. I do agree that there should be a better way of handling this, though...

@orent
Copy link
Author

orent commented Sep 23, 2024

All python.org releases on windows, linux and mac do. Other than obscure embedded versions of python, I don't recall encountering python without a dynamic library for over a decade an a half.

You can find an even more complete method for finding the library here:

https://github.com/JuliaPy/PyCall.jl/blob/master/deps/find_libpython.py

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

No branches or pull requests

2 participants