Blender is ignoring PYTHONPYCACHEPREFIX #124953
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#124953
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Linux-6.9.9-arch1-1-x86_64-with-glibc2.39 64 Bits, WAYLAND UI
Graphics card: AMD Radeon Graphics (radeonsi, renoir, LLVM 18.1.8, DRM 3.57, 6.9.9-arch1-1) AMD 4.6 (Core Profile) Mesa 24.1.3-arch1.1
Blender Version
Broken: version: 4.2.0, branch: blender-v4.2-release, commit date: 2024-07-16 06:20, hash:
a51f293548ad
Worked: (newest version of Blender that worked as expected)
Short description of error
PYTHONPYCACHEPREFIX was added in Python 3.8 to allow pycache files to be kept in a user-defined location. This environment variable is being ignored by blender, causing pycache files to 'contaminate' the .config/blender/4.2/scripts/addons directory.
This is particularly problematic if the addons directory is being shared by multiple blender sessions (e.g. via Google Drive sync or similar). The contention over the python cache files causes all kinds of trouble.
Reference for the variable and its expected behavior: https://peps.python.org/pep-0304/
Exact steps for others to reproduce the error
Set PYTHONPYCACHEPREFIX to point to a existing file system location, e.g.
mkdir /var/tmp/pycache
export PYTHONPYCACHEPREFIX=/var/tmp/pycache/
Check contents of the PYTHONPYCACHEPREFIX directory. There will be no files from blender.
This works when running Blender with Python system environment enabled.
blender --python-use-system-env
Closing.
Oh, interesting. Was there an explicit change / motivation that causes this to be needed now when it wasn't before? It seemed like a bug just because the behavior changed from previous versions.
See
7c2f0074f3
& #72807 for the motivation.Thanks. Oddly, though, 4.1.1 seems to behave OK, so this is why I filed the bug for 4.2. Something seemed to have changed, but those links are fairly elderly. Hence still somewhat confused - there would appear to be a distinct difference between 4.1.1 and 4.2.
Most likely caused by a regression, fixed by:
cd5dd6e454