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

CMake selects the wrong Python version if a newer non-default install exists #84

Open
ideoforms opened this issue May 3, 2021 · 2 comments
Labels

Comments

@ideoforms
Copy link
Owner

On a system with two Python installs, in which the older of the two is the default, CMake will find and build with the newer (reported by kraysh). This causes run-time linking to fail. This bug is mentioned here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252277

CMake should be instructed to build with the default (i.e, whichever is symlinked by python3). There does not seem to currently be a way to do this, so the recommended fix is to delete the newer non-default version, or build and run from a virtualenv.

@ideoforms ideoforms added the bug label May 3, 2021
@ideoforms
Copy link
Owner Author

ideoforms commented May 3, 2021

On a system with Python 3.8 and 3.9, this generates the error

Symbol not found: _PyCMethod_New

@ideoforms
Copy link
Owner Author

This is fixed for virtualenvs in the latest CMakeLists, by using Python_FIND_VIRTUALENV (available in CMake since version 3.15.0). Need to check whether this still affects non-virtualenv systems with multiple Python installs.

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

No branches or pull requests

1 participant