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

Laubwerk Python Extension doesn't support Python 3.10 (So Blender 3.1 and later are unsupported) #56

Open
gianlucaf81 opened this issue Mar 1, 2023 · 18 comments

Comments

@gianlucaf81
Copy link

gianlucaf81 commented Mar 1, 2023

Describe the bug
thicket-0_4_1_rc0.zip

Failed to load Laubwerk Python Extension from this path
error message.

Screenshots

https://ibb.co/yX1Z8g7
https://ibb.co/Csm8vhw

Describe the bug
thicket-0_4_0.zip

https://ibb.co/StNFt81

Desktop (please complete the following information):

  • OS: [Windows]
  • OS Version [10 22H2]
  • Blender Version [3.2.0]
@dvhart
Copy link
Collaborator

dvhart commented Mar 1, 2023

Thanks for reporting the bug @gianlucaf81 . I haven't done an update for Blender 3.x in a while, so a change in API is possible, even likely. I'll have a look.

In the meantime, can you try two things?

  1. Which version of Laubwerk are you using?
  2. Did you install the Python plugin during the Laubwerk installation as described in the README?

@gianlucaf81
Copy link
Author

Hi, thak you for the answer.

  1. I tried LaubwerkPlantsKitFreebie 1.0.33 and also 1.0.43
    1b. I tried a clean installation of 1.0.43
  2. yes, I put the screenshot of the Python folder for comparison if it could possibly be useful.
    I remain available for any test you ask me to do. Thank you.

@dvhart
Copy link
Collaborator

dvhart commented Mar 2, 2023

OK, so the 0_4_1_rc0 release seems to work up through and including blender 3.1. In my 3.4 installation, the import fails with:

import laubwerk
Traceback (most recent call last):
File "/Library/Application Support/Laubwerk/Python/laubwerk/init.py", line 39, in
from laubwerk._laubwerk import *
ImportError: dlopen(/Library/Application Support/Laubwerk/Python/laubwerk/_laubwerk.so, 0x0002): symbol not found in flat namespace (_PyCObject_Type)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Applications/Blender.app/Contents/Resources/3.4/python/lib/python3.10/code.py", line 90, in runcode
exec(code, self.locals)
File "<blender_console>", line 1, in
File "/Library/Application Support/Laubwerk/Python/laubwerk/init.py", line 42, in
raise ImportError('Unable to import Laubwerk module: {}'.format(err))
ImportError: Unable to import Laubwerk module: dlopen(/Library/Application Support/Laubwerk/Python/laubwerk/_laubwerk.so, 0x0002): symbol not found in flat namespace (_PyCObject_Type)

This appears to be another issue with the Blender python installation. I'll file a ticket and see what comes of it.

@dvhart
Copy link
Collaborator

dvhart commented Mar 2, 2023

I've opened a blender issue: https://projects.blender.org/blender/blender/issues/105360

In the meantime, can you confirm if Blender 3.1 works for you?

@gianlucaf81
Copy link
Author

gianlucaf81 commented Mar 2, 2023

Laubwerk

Hi, thank you for the support.
I downloaded the 3.1.0 portable version but it gives me the same problem with both versions. I don't know at this point if it's my mistake or a misconfiguration.I'll try on another pc in the morning.

UPDATE

I've tried with Blender 3.0.0 this is the result.
0.4.0 same error
0.4.1 rebuild database button is red but seems don't work.

https://ibb.co/hyyXNDh

@dvhart
Copy link
Collaborator

dvhart commented Mar 2, 2023

It looks like I meant 3.0.1, as 3.1 also moved to Python 3.10. It looks like this may be a limitation of the Laubwerk python extension (supports only up to 3.9). I'll work to confirm tonight. If that's the case, I'll reach out to Laubwerk for support.

@dvhart
Copy link
Collaborator

dvhart commented Mar 2, 2023

I'm not sure what would cause the rebuild db to fail in that way, I haven't seen that before. I successfully rebuild the DB on 3.0.1 with Thicket 0.4.1 on Mac (but with Laubwerk 1.0.37).

I'm going to focus on the python 3.10 support from Laubwerk, but will see if I can repro the DB issue as well.

@dvhart dvhart changed the title Failed to load Laubwerk Python Extension from this path Laubwerk Python Extension doesn't support Python 3.10 (So Blender 3.1 and later are unsupported) Mar 3, 2023
@dvhart
Copy link
Collaborator

dvhart commented Mar 3, 2023

@tdapper The Laubwerk Python Extension ships with _laubwerk.cpython shared object files for Python 3.4 through 3.9. As of Blender 3.1, Blender ships with Python 3.10, preventing the Laubwerk python module from loading with the following error:

ImportError: Unable to import Laubwerk module: dlopen(/Library/Application Support/Laubwerk/Python/laubwerk/_laubwerk.so, 0x0002): symbol not found in flat namespace (_PyCObject_Type)

Would you please consider adding Python 3.10 support to the next release?

@gianlucaf81
Copy link
Author

I'm not sure what would cause the rebuild db to fail in that way, I haven't seen that before. I successfully rebuild the DB on 3.0.1 with Thicket 0.4.1 on Mac (but with Laubwerk 1.0.37).

I'm going to focus on the python 3.10 support from Laubwerk, but will see if I can repro the DB issue as well.

Thanks, could you give me version 1.0.37 to test?

@dvhart
Copy link
Collaborator

dvhart commented Mar 4, 2023

@gianlucaf81 I can't redistribute the Laubwerk binaries (and interestingly enough, I don't actually have a copy of the 1.0.37 installer. I'll work on confirming 1.0.43 is working with Blender 3.0 and then trying to debug why your installation isn't working. One thing that would help me is to launch Blender from the terminal and share any output from the Thicket add on.

@dvhart
Copy link
Collaborator

dvhart commented Mar 4, 2023

@gianlucaf81 I found that when installing a fresh Laubwerk 1.0.43, the Python Extension still reports as 1.0.39. This makes me wonder if there might be a difference in the Mac and Windows Python Extension shipped in the Laubwerk Plant Kit Freebie - and if 1.0.43 is newer in the Windows version you're using, there might be a problem there that I can't replicate on the Mac which shows as 1.0.39. Reading through the above, it doesn't look like you have tried Blender 3.0.1 with Laubwerk 1.0.33 and Thicket 0.4.1 - would be able to give that a try? In the meantime, I'm in contact with Laubwerk and working toward a proper fix for Blender 3.2 and later.

@gianlucaf81
Copy link
Author

I tried this morning with Blender 3.0.1 also deleting the script folder but the result is this:

https://ibb.co/QQFMkm8
https://ibb.co/6JgJ303

Now I try with a virtual machine and see what happens.

@dvhart
Copy link
Collaborator

dvhart commented Mar 6, 2023

@gianlucaf81 OK, the 0.4.0 behavior is expected, Blender 3.0 API changes require the 0.4.1 Thicket add on. What I'd need to understand what's going in the 0.4.1 case is either the console output (by running Blender from the Window terminal), or manually attempting to import the Laubwerk modules from Blender Python Console, with something like:

import sys
sys.path.append("path to laubwerk python")
import laubwerk

@gianlucaf81
Copy link
Author

gianlucaf81 commented Mar 7, 2023

@gianlucaf81 OK, the 0.4.0 behavior is expected, Blender 3.0 API changes require the 0.4.1 Thicket add on. What I'd need to understand what's going in the 0.4.1 case is either the console output (by running Blender from the Window terminal), or manually attempting to import the Laubwerk modules from Blender Python Console, with something like:

import sys
sys.path.append("path to laubwerk python")
import laubwerk
PYTHON INTERACTIVE CONSOLE 3.9.7 (default, Oct 11 2021, 19:31:28) [MSC v.1916 64 bit (AMD64)]

Builtin Modules:       bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bpy.utils, bgl, blf, mathutils
Convenience Imports:   from mathutils import *; from math import *
Convenience Variables: C = bpy.context, D = bpy.data

>>> import sys
>>> sys.path.append("C:\Program Files\Laubwerk\Python")
>>> import laubwerk
Traceback (most recent call last):
  File "C:\Program Files\Laubwerk\Python\laubwerk\__init__.py", line 17, in <module>
    from laubwerk._laubwerk import *
ImportError: DLL load failed while importing _laubwerk: Impossibile trovare il modulo specificato.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "C:\Program Files\Laubwerk\Python\laubwerk\__init__.py", line 19, in <module>
    raise ImportError('Unable to import Laubwerk module: {}'.format(err))
ImportError: Unable to import Laubwerk module: DLL load failed while importing _laubwerk: Impossibile trovare il modulo specificato. 

@dvhart
Copy link
Collaborator

dvhart commented Mar 7, 2023

Thanks @gianlucaf81, OK, that looks like it's failing to find a dll. Can you capture a listing (or screenshot) of the Laubwerk/Python/laubwerk/ contents? There should be a listing of .dll files, one should have "39" in the name, which is required to work with Python 3.9 (the error message suggests that might be missing).

@gianlucaf81
Copy link
Author

gianlucaf81 commented Mar 7, 2023

Grazie@gianlucaf81, OK, sembra che non riesca a trovare una dll. Puoi acquisire un elenco (o uno screenshot) dei contenuti di Laubwerk/Python/laubwerk/? Dovrebbe esserci un elenco di file .dll, uno dovrebbe avere "39" nel nome, che è necessario per lavorare con Python 3.9 (il messaggio di errore suggerisce che potrebbe mancare).

https://ibb.co/1q53FDM

Houston, we have a problem

Python Folder.txt

@dvhart
Copy link
Collaborator

dvhart commented Mar 10, 2023

@gianlucaf81 Ok, that explains the error you are seeing and why it differs from what I see on Mac OS. So for a Blender 3.0+ support we need to wait for Laubwerk to update their Python Extension to include Python 3.10 support (and 3.9 for Blender 3.0.1). For the single release of Blender 3.0.1, which still uses Python 3.9, the Laubwerk Python Extension for Mac has the necessary support, while it appears to be missing from the Windows package.

With the single exception of Blender 3.0.1 on Mac OS (which works with Thicket 0.4.1), we are blocked on an update from Laubwerk. I will continue to work with Laubwerk to have Thicket support ready as soon after their release as possible.

@dvhart dvhart pinned this issue Mar 10, 2023
@tdapper
Copy link
Contributor

tdapper commented Mar 28, 2023

@dvhart, just so you know, the 1.0.44 Laubwerk Extension has been released. It may have a few additional changes that will require Thicket to be updated, but support for Python 3.10 and 3.11 are there now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants