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

Import Fixes #317

Merged
merged 2 commits into from
Oct 16, 2022
Merged

Import Fixes #317

merged 2 commits into from
Oct 16, 2022

Conversation

NullSenseStudio
Copy link
Collaborator

For some people the subprocess has managed to load external modules and cause odd issues. I've tracked down these ways that it may happen and should no longer be a problem with these changes.

  1. PYTHONPATH environment variable: Becomes an issue when Blender is run with --python-use-system-env since the subprocess inherits Blender's environment variables. Now it'll always be removed from the subprocess's environment.
  2. User site: Blender will block use of the user site unless ran with --python-use-system-env, but the subprocess doesn't inherit this functionality. -s command line argument will prevent this.
  3. Blender's site-packages: Some other addons may install their own packages there, and potentially packages installed from older versions of the addon may no longer be compatible. Reordered sys.path so modules will be looked for within the addon before any paths from the python interpreter.

Only reported issue that I know this will fix is #205 (loaded an outdated version of pillow, likely within user site like Smuzzies commented). Potentially others that haven't been properly tracked down too.

@carson-katri carson-katri added the bug Something isn't working label Oct 16, 2022
@carson-katri carson-katri added this to the v0.0.8 milestone Oct 16, 2022
Copy link
Owner

@carson-katri carson-katri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@carson-katri carson-katri merged commit 36d4b07 into carson-katri:main Oct 16, 2022
@NullSenseStudio NullSenseStudio deleted the import-changes branch October 17, 2022 01:45
JasonHoku pushed a commit to JasonHoku/dream-textures that referenced this pull request Dec 20, 2022
* restrict PYTHONPATH and user site from subprocess

* reorder sys.path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants