Blender 2.82 doesn't capture numpy path when WITH_PYTHON_INSTALL_NUMPY=OFF #74304

Closed
opened 2020-02-28 19:53:02 +01:00 by veprbl · 8 comments

System Information
Operating system: Linux, macOS
Graphics card:

Blender Version
Broken: v2.82
Worked: v2.81a

Short description of error
https://developer.blender.org/D6598 causes a regression for WITH_PYTHON_INSTALL_NUMPY=OFF
Downstream bug: https://github.com/NixOS/nixpkgs/issues/81218

Exact steps for others to reproduce the error

  1. Build blender with numpy installation outside of PYTHONHOME and options
  • DWITH_PYTHON_INSTALL=OFF
  • DWITH_PYTHON_INSTALL_NUMPY=OFF
  1. Launch blender, go to "Scripting" tab, execute "import numpy"
  2. Observe:
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'

Workaround

  1. Use blender with --python-use-system-env

OR

  1. Use blender with --python-expr "import sys; sys.path.append("${python3Packages.numpy}/${python.sitePackages}")"
**System Information** Operating system: Linux, macOS Graphics card: **Blender Version** Broken: v2.82 Worked: v2.81a **Short description of error** https://developer.blender.org/D6598 causes a regression for WITH_PYTHON_INSTALL_NUMPY=OFF Downstream bug: https://github.com/NixOS/nixpkgs/issues/81218 **Exact steps for others to reproduce the error** 1) Build blender with numpy installation outside of PYTHONHOME and options - DWITH_PYTHON_INSTALL=OFF - DWITH_PYTHON_INSTALL_NUMPY=OFF 2) Launch blender, go to "Scripting" tab, execute "import numpy" 3) Observe: ``` Traceback (most recent call last): File "<blender_console>", line 1, in <module> ModuleNotFoundError: No module named 'numpy' ``` **Workaround** 1) Use blender with --python-use-system-env OR 2) Use blender with --python-expr "import sys; sys.path.append(\"${python3Packages.numpy}/${python.sitePackages}\")"
Author

Added subscriber: @veprbl

Added subscriber: @veprbl
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Member

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'
Ankit Meel self-assigned this 2020-02-28 21:33:59 +01:00
Member
your workaround 1 is *the* way to do it. [D6598](https://archive.blender.org/developer/D6598) https://devtalk.blender.org/t/python-imports-in-2-82-are-not-working/11380/7 https://blender.stackexchange.com/questions/5287/using-3rd-party-python-modules https://docs.blender.org/manual/en/latest/editors/preferences/file_paths.html?highlight=scripts%20python%20preferences#scripts-path
Member

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Member

poking @ideasman42 in case there's a regression in WITH_PYTHON_INSTALL_NUMPY.

poking @ideasman42 in case there's a regression in `WITH_PYTHON_INSTALL_NUMPY`.
Author

I guess, the issue is not that blender stopped interpreting PYTHONPATH, but that WITH_PYTHON_INSTALL=OFF keeps blender linked to a specific python library, but WITH_PYTHON_INSTALL_NUMPY doesn't link to a specific installation of numpy. And this is normal in the python world where things are commonly left to the late binding and downstream distributions know how to handle this in a uniform way. But you disable some of the standard late binding mechanisms in https://developer.blender.org/D6598 and leave no suggested way to bind blender and a specific installation of numpy.

Overall, this is non-issue, really. Of course downstream can overcome this with some hacks. I'm only reporting just in case this may be considered a bug. Thank you for looking into this.

I guess, the issue is not that blender stopped interpreting PYTHONPATH, but that WITH_PYTHON_INSTALL=OFF keeps blender linked to a specific python library, but WITH_PYTHON_INSTALL_NUMPY doesn't link to a specific installation of numpy. And this is normal in the python world where things are commonly left to the late binding and downstream distributions know how to handle this in a uniform way. But you disable some of the standard late binding mechanisms in https://developer.blender.org/D6598 and leave no suggested way to bind blender and a specific installation of numpy. Overall, this is non-issue, really. Of course downstream can overcome this with some hacks. I'm only reporting just in case this may be considered a bug. Thank you for looking into this.
Author

We recently learned that the second workaround is not working well https://github.com/NixOS/nixpkgs/issues/82337

We recently learned that the second workaround is not working well https://github.com/NixOS/nixpkgs/issues/82337
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
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
EEVEE & Viewport
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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
EEVEE & Viewport
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
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#74304
No description provided.