-
Notifications
You must be signed in to change notification settings - Fork 68
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
AttributeError: 'bpy.app' object has no attribute 'binary_path_python' #80
Comments
Thanks for looking into this. It was reported to me on Blender Chat a couple of minutes ago as well: https://blender.chat/channel/python?msg=hPpgYx5cfpZvrxpLg The solution should be to simply use |
Here are the first few lines in environment.py with the modifications which fixed the issue for me:
|
I do not think just using sys.executable is a good idea, this will break the extension for everyone who does not use latest Alpha version. Using sys.executable was the first thing I tried, but it did not work as expected. Today I decided to check again and upgraded to the latest master and sys.executable returns path to the Python executable. This allows to simplify my previous code like this:
The code above will break the addon only for single nightly Alpha build, but all official releases and current master will work properly. So I think this is the best solution. I do not know if sys.executable ever worked in versions lower than current 2.92 so I decided to try 2.90 and got the following:
Just few days ago 2.92 Alpha also had the same behavior, sys.executable contained path to the Blender executable. For comparison, with today's 2.92 latest Alpha build, sys.executable contains path to the Python executable:
|
This still has to be updated at some point. But we are good for one more release: https://developer.blender.org/rBa1f46ac9dc71d66adced895a98f912a5d8440748 |
This one did wonders for me |
bpy.app.binary_path_python
was deprecated in 2.91 and removed for 2.92 in favor ofsys.executable
by the following commit:https://developer.blender.org/rB6527a14cd2ceaaf529beae522ca594bb250b56c9
As a result, this extension stopped working because of the error on startup:
AttributeError: 'bpy.app' object has no attribute 'binary_path_python'
Strange, but for me sys.executable returns path to the Blender executable:
I found https://blender.stackexchange.com/questions/139718/install-pip-and-packages-from-within-blender-os-independently where it is suggested to use
sys.prefix
instead, and my solution below is based on this suggestion. I do not know if usingbpy.app.binary_path_python
is necessary for compatibility with old Blender versions. If it isn't, the following change inenvironment.py
could solve the issue:If it is necessary to use
bpy.app.binary_path_python
for old Blender versions, then the following code would work:Since I'm not sure what is the best fix for this, I decided to open an issue instead of PR.
The text was updated successfully, but these errors were encountered: