Skip to content

Conversation

@lukashof
Copy link

@lukashof lukashof commented Nov 5, 2025

There are various instances where data like scene or geometry files is loaded and getProgramPath() is used to find the right folder. However, when using the Python bindings from a virtual environment using the built-in venv-Module this won't work, since the method returns the path to the global Python interpreter. The only (very crude) workaround I have previously found was to place the relevant data in the global interpreter, which is not ideal and requires admin-privileges.

This PR contains a modification to find the correct Path of the venv, if the python bindings are used. I realize the implementation is a bit simplistic and depends on the found executable's name, and might therefore not cover all available Python distributions.

I made no changes to the Apple implementation, since I don't have a machine available to test this on.

I have previously discussed this with @digitalillusions in #283, where he mentioned that the issue does not occur with Anaconda. I tested my solution with Anaconda on Windows as well and had no issues.

This might solve the problems from discussion #151 and #254, although the latter one was already closed.

Looking forward to any feedback!

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

Successfully merging this pull request may close these issues.

1 participant