Conversation
| The fix is to force the following environement variables (replace XX by your python version) before launching Idefix: | ||
|
|
||
| ```bash | ||
| export PYTHONPATH=$VIRTUAL_ENV/lib/python3.XX/site-packages:$PYTHONPATH |
There was a problem hiding this comment.
This has much more consequences and can easily create a worse situation for a user, especially if they see the export as a suggestion to hardcode this line into a .bashrc or similar config file.
I'd strongly advise against this.
There was a problem hiding this comment.
I don't see where it says this should be in .bashrc. My question would be: do you have a better proposition?
There was a problem hiding this comment.
to be more constructive, I would suggest making pydefix a proper Python package if it makes sense (and it doesn't, there is a bigger problem to address here)
There was a problem hiding this comment.
There was a problem hiding this comment.
the problem is not due to pydefix (a c++ class in idefix), but to pybind11, which is already a python package. On Idefix startup, pybind11 does not necessarily pick up the python interpreter from the current venv.
There was a problem hiding this comment.
I think I need to study how this is implemented for a couple minutes (possibly longer) before I can meaningfully contribute to this discussion, but I strongly feel like I should. Can I get back to you later this week ?
There was a problem hiding this comment.
for future reference:
the proposed fix comes from:
https://stackoverflow.com/questions/53480120/embedding-pybind11-with-virtual-environment
Similar issues may be found on the web, such as:
https://gitlab.kitware.com/autopybind11/autopybind11/-/issues/97
No description provided.