-
Notifications
You must be signed in to change notification settings - Fork 309
Use Pybind11's find python tool to correctly locate python install information #950
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
Use Pybind11's find python tool to correctly locate python install information #950
Conversation
Wow! Fantastic find (so to speak ;) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a relief to see that the fix is so simple, after all the research and experimentation it took to get here!
Yes, I'm happy it ends up like this :) |
Don't forget to merge with squashing to avoid cosmetic commits (I've made the changes into the github's IDE directly and it didn't go perfectly in the first place...) |
Just need to clear the checks. Looks like the comment I requested triggered a line length error....! Oh I see you got it already ;)
|
Codecov Report
@@ Coverage Diff @@
## master #950 +/- ##
==========================================
- Coverage 85.65% 85.64% -0.01%
==========================================
Files 191 191
Lines 18153 18157 +4
Branches 2058 2061 +3
==========================================
+ Hits 15549 15551 +2
- Misses 2082 2083 +1
- Partials 522 523 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I edited the title of the PR to reflect what it is doing (to make generating the change notes for the future release easier) |
Thanks! |
@Tilix4 We've just found a regression. If one creates a python2.7 conda environment, but python 3.8 is the default python in your path, pybind11 now finds the default python 3.8, not the python that is first in the path. In other words, if I build, using python 2.7, pybind11 prefers python 3.8. It looks like a bit more research is required....! Prior to this commit, pybind11 correctly picks the active python 2.7, or 3.8 as appropriate. |
Reading the documentation around FindPython in the pybind11 documents is not encouraging - it says things like "with virtualenv/venv support, and Conda support, this tends to find the correct Python version more often than the old system did". |
@meshula Okay, I'll have a look. First of all I'll try to reproduce the issue. |
@meshula I'm sorry but I cannot reproduce this issue. I've installed a 2.7 conda env: https://repo.anaconda.com/archive/Anaconda2-2019.10-Windows-x86_64.exe I've tested what follows with both python 3.7 and recently (today) installed 3.8:
If you may provide a
Maybe I don't understand this quote correctly but if FindPython is what we are using, it seems to be the appropriate solution. |
I did almost the same as you, except the inverse. My conda base is 3.8, and I created a 2.7 env... I deleted my otio27 environment and reconstructed it from scratch, and now the problem does not recur. I'll double check with the user who reported the issue. Thanks for following up, much appreciated. |
Hey all, I have am actually having this issue. I have python 3.9 install in my /usr/local directory (on Mac). When I invoke setup.py from the system Python (2.7). I end up with python bindings built for 3.9 in my python 2.7 site packages and the build is not useable. I can confirm that when I remove the You can see my full investigation in these Slack threads: If you want me to run any tests on my machine let me know. I will try seeing if replacing both |
I can confirm that using You can find my changes here: |
Fixes #813
Link the Issue(s) this Pull Request is related to.
Each PR should link at least one issue, in the form:
Fixes #823
Use one line for each Issue. This allows auto-closing the related issue when the fix is merged.
Added the pybind11 smart tool to find python: https://pybind11.readthedocs.io/en/latest/compiling.html#findpython-mode
On windows:
/path/to/blender/python -m pip install
wasn't working.