pcb2blender icon indicating copy to clipboard operation
pcb2blender copied to clipboard

Python error on linux

Open nick-bors opened this issue 1 year ago • 14 comments

Extension wont activate: image

Pip is installed: image

Any help as to how i can fix this? I installed pillow on my system too.. and blender's own pip environment seems to have PIL installed.

nick-bors avatar Oct 06 '24 15:10 nick-bors

Im on blender 4.2.1 LTS, which i think is supported

nick-bors avatar Oct 06 '24 15:10 nick-bors

Not sure what's the issue here tbh, only thing that seems wrong is your python version. It should be 3.11 but is 3.12 for some reason (incorrect packaging most likely).

Looking at that installation path, it could in theory also be a dependency collision with some other extension you installed.

30350n avatar Oct 06 '24 23:10 30350n

Not sure what's the issue here tbh, only thing that seems wrong is your python version. It should be 3.11 but is 3.12 for some reason (incorrect packaging most likely).

Looking at that installation path, it could in theory also be a dependency collision with some other extension you installed.

Is there a breaking change in 3.12 from 3.11? It should still run i assume the version bump does not include breaking changes.

Also, its not a dependency collision as i tried removing my plugins (of which there was only one anyways, which im pretty sure did not utilize pip). Running ls on the .local/lib/python3.12/site-packages/PIL directory shows its completely empty, and the directory and the __init__.py file does not exist. Any guidance? im going to do a system upgrade now in hopes that it fixes things but maybe a way to manually install pip and/or symlink it to the directory would be good. I still have no clue how blender is seeing some version of pil, even though its not present in .local anywhere

nick-bors avatar Oct 08 '24 15:10 nick-bors

Is there a breaking change in 3.12 from 3.11? It should still run i assume the version bump does not include breaking changes.

Generally no, but Blender not using the correct python version generally hints that whoever packaged Blender for whatever distro you are using messed up. It could for example be that they decided to reuse your system Python for Blender, in which case, It could be that and outdated version of pillow (or worse, PIL) is installed there.

It could also be that the pillow wheel included with the extension (pillow-10.4.0-cp311-cp311-manylinux_2_28_x86_64.whl from here) somehow fails to install because of the version mismatch.

30350n avatar Oct 08 '24 15:10 30350n

I have the same problem under blender 4.2.1 :

Capture d’écran du 2024-10-21 15-54-42

Sorry, newbie here, but, you need to install pip in order to run the module pcb importer ?

When I run the commands of @fami-fish (PIL / print(PIL.version) it seem "PIL" is not installed :

Capture d’écran du 2024-10-21 16-05-29

On the first try of enabling pcb importer the problem was "no module named skia", after reboot of blender, it is now the PIL error.

I am on fedora 40.

babolait avatar Oct 21 '24 14:10 babolait

Like I said previously, this is most likely a packaging issue, not an issue with this extension or Blender. In the case of Fedora 40, it almost definitely is:

image

So either install Blender by directly downloading a build from https://www.blender.org/download/ or possibly by using something like flatpak.

The other option would be to bug your responsible package maintainer to fix their packaging to produce non broken Blender builds.

30350n avatar Oct 21 '24 14:10 30350n

I can confirm this issue also occurs for me on Arch Linux.

mothdotmonster avatar Oct 25 '24 07:10 mothdotmonster

I can confirm this issue also occurs for me on Arch Linux.

Seems like someone already created a bug report there atleast. Could you check if it works with the blender-bin package from the AUR? @mothdotmonster That one should ship with the correct bundled python version.

30350n avatar Oct 25 '24 14:10 30350n

Like I said previously, this is most likely a packaging issue, not an issue with this extension or Blender. In the case of Fedora 40, it almost definitely is:

image

So either install Blender by directly downloading a build from https://www.blender.org/download/ or possibly by using something like flatpak.

The other option would be to bug your responsible package maintainer to fix their packaging to produce non broken Blender builds.

I tried with the version downloaded directly from blender website. I am new to fedora / linux, so not sure if I have done it correctly. I tried installing your module and get the same error. After that I installed it using flatpak. It is the 4.11. So when installed, I installed the dependencies (doing .venv and other console lines as asked) of blender (I assume they are needed for your module ?), using their tutorial.

I went for the install of your module, it could not load it cause of the init.py being at the top level, I created a folder and re-zipped it. Blender took the module, and said "module at XX installed at XXX" (see attachment), but when I search for it in the list, impossible to find it, do you have an idea ? I refreshed it, reboot the computer, re-do the installation but impossible to get it in the list and enable it.

Capture d’écran du 2024-10-25 18-49-18

I am sorry if those question are trivial, I have very hard time finding info on the install ;) I can post that message elsewhere if you want. Thank you

babolait avatar Oct 25 '24 16:10 babolait

I tried with the version downloaded directly from blender website. I am new to fedora / linux, so not sure if I have done it correctly. I tried installing your module and get the same error.

Can you share a screenshot of that again, aswell as a screenshot of your python console, as before?

After that I installed it using flatpak. It is the 4.11.

I guess you mean 4.1.1 here? The current version of this plugin only supports 4.2+ so that's not going to work.

So when installed, I installed the dependencies (doing .venv and other console lines as asked) of blender (I assume they are needed for your module ?), using their tutorial.

Not sure what that's supposed to mean exactly, but none of that should be required.

Installation should be as simple as downloading Blender and installing the PCB Importer extension via the builtin extensions UI.

30350n avatar Oct 27 '24 00:10 30350n

Thank you for your answer.

I tried with the version downloaded directly from blender website. I am new to fedora / linux, so not sure if I have done it correctly. I tried installing your module and get the same error.

Can you share a screenshot of that again, aswell as a screenshot of your python console, as before?

In fact my problem is that I still don't get very well how to install stuff in fedora / linux. When I tried with direct source on blender, I had a folder with a .exe, and when launching the app it work well but I was searching for a way to "install" it (have the app show up in the gnome), so I stopped here.

As for now, I launch the .exe and it work. After that your module that I had already installed showed up and I activated it and then imported the kicad generated file and it work like a charm, on fedora / blender 4.2.3 LTS.

On my render, do you know why there is black lines on my pcb ?

Capture d’écran du 2024-10-27 15-46-31

babolait avatar Oct 31 '24 10:10 babolait

On my render, do you know why there is black lines on my pcb ?

Because you are only previewing in viewport render mode. (Those lines represent relationships between objects).

30350n avatar Oct 31 '24 17:10 30350n

Okay same issue Fedora 40 user. I tried installing the missing packages in python 3.12 this didn't work. Flatpak did work.

asdf23 avatar Dec 05 '24 21:12 asdf23

Same issue on Manjaro Release 2024-12-16. Blender build with python version 3.12.7. As this plugin is 100% python code, what is the reason it doesn't work with a higher version?

2old4it avatar Jan 16 '25 15:01 2old4it

I experience a similar issue in Debian trixie/testing: The importer can be installed via the blender GUI. But on activation I just get an error message: RuntimeError: Extension bl_ext.blender_org.pcb3d_importer is incompatible (This Python version (3.13) isn't compatible with (3.11)) The debian package depends on libpython 3.13 (>=3.13.0). So just like arch from the bug report above, blender as distributed by Debian depends on the systems version of python3. Given the multitude of python dependencies in blender, there is little chance that Debian would change their packaging policy. They'd essentially have to maintain an additional set of python libs just for blender. Is there any way to bump the python version of the importer add-on?

KaiMartin avatar Apr 19 '25 21:04 KaiMartin

Is there any way to bump the python version of the importer add-on?

I tried to clone the project and bump the required version of python3 myself. Unfortunately, getting the plugin to load in blender turned out to be beyond my skill level.

So I reluctantly uninstalled the Debian package and downloaded a blender binary directly from blender.org . As hinted above, this binary comes with python 3.11 . Consequently, it successfully loads the plugin. My PCBs rendered beautifully. Good job on the choice of colors and materials!

KaiMartin avatar Apr 20 '25 06:04 KaiMartin

Yeah, a lot of popular linux distros are sadly incapable of correctly packaging Blender, shipping wrong python versions.

Glad you got it figured out and thank you for the kind words!

30350n avatar Apr 20 '25 10:04 30350n