Make used Python path available to the BGE #52655
Labels
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#52655
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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
Windows 10
Blender Version
2.78c
Short description
The Python interpreter path should be made available to the
bge
module.Currently on Windows to get the currently-used Python path we would use
sys.executable
, but this line returns the Blender executable, not Python's...The
bpy
module does provide the path, but its not usable from the BGE (think about a standalone).Fix
Similarly to
bpy.app.binary_path_python
, have anbge.app.binary_path_python
available.Changed status to: 'Open'
Added subscriber: @WKnight02
Added subscriber: @JacobMerrill-1
when you are installing modules into blender, you must install them into blender/python
there was talk of pip install working inside blender, but I have had issues with it.
standalone module will have it's own python interpreter, which will need the same libs.
Pip does works flawlessly with Blender, as there is some
ensurepip
module bootstrapping pip for the Python installation packed with Blender. More.But for some test project I had to register the Python executable path from a BGE runtime (read: from a running game), but was unable to retrieve the Python executable path.
Although I do not understand the point of mentioning pip, which does works, the problem is that we can get access to the Python's path from
bpy
, but not frombge
.you mean bge.logic.expandPath(path) ?
https://docs.blender.org/api/blender_python_api_2_70_5/bge.logic.html#bge.logic.expandPath
edit: try and pip install and import pyttsx or tensor flow
pip install pyttsx3
for Blender's Python 3.5.x is working correctly... Make sure to have admin rights if you're installing libs in your"C:\Program Files"
directory... Won't test fortensorflow
, as it is not the problem (it will work for sure, given you type the right commands)Edit: tested for
tensorflow
just in case: it worked.bge.logic.expandPath
converts a path. It is not the problem: What should be interesting would be something likebge.app.binary_path_python
returning, say:C:\Program Files\Blender Foundation\Blender\2.78\python\bin\python.exe
. or any other location depending on the OS.Added subscriber: @Sergey
Changed status from 'Open' to: 'Archived'
Thanks for the report, but it's more a feature request than a bug which we don't accept in the bug tracker. Such requests better be addressed to bf-funboard (general functional discussion board) or bf-gamedev (BGE related discussions) mailing lists.
Thanks, didn't know where to address !