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

Shapely.lib not found #178

Open
ydnatag opened this issue Sep 10, 2024 · 8 comments
Open

Shapely.lib not found #178

ydnatag opened this issue Sep 10, 2024 · 8 comments

Comments

@ydnatag
Copy link

ydnatag commented Sep 10, 2024

It is really weird bug. When I open blender and install blendercam, it works opening all panels and configurations. But if I close blender and open it again, blendercam is not loaded. Going to add-ons config and re enabling it, I'm getting the following error:

Shapely.lib not found

Regards,
A.

@Gurgi66
Copy link

Gurgi66 commented Sep 10, 2024

I was on Arch Linux, and i can solve this by simply install the shapely.lib from the repos of my linux system. It was a python library.

@pppalain
Copy link
Owner

pppalain commented Sep 10, 2024

oh on blender 4.2, you need to load through the extensions. we are working to try to get 4.2 compatibility. not easy.
image

the last stable blendercam for 4.1 is 1.0.27.

@ydnatag
Copy link
Author

ydnatag commented Sep 16, 2024

I can't enable or install blendercam again in my blender installation. Get Extensions keeps in gray:
image

This is in the terminal:

Skipping wheel for other system (macosx_10_9_x86_64 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-macosx_10_9_x86_64.whl
Skipping wheel for other system (macosx_11_0_arm64 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-macosx_11_0_arm64.whl
Skipping wheel for other system (manylinux_2_17_aarch64.manylinux2014_aarch64 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Skipping wheel for other system (win_amd64 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-win_amd64.whl
Skipping wheel for other system (win32 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-win32.whl
Skipping wheel for other system (macosx_10_9_x86_64 != linux_x86_64): shapely-2.0.5-cp311-cp311-macosx_10_9_x86_64.whl
Skipping wheel for other system (macosx_11_0_arm64 != linux_x86_64): shapely-2.0.5-cp311-cp311-macosx_11_0_arm64.whl
Skipping wheel for other system (manylinux_2_17_aarch64.manylinux2014_aarch64 != linux_x86_64): shapely-2.0.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Skipping wheel for other system (win_amd64 != linux_x86_64): shapely-2.0.5-cp311-cp311-win_amd64.whl
Skipping wheel for other system (win32 != linux_x86_64): shapely-2.0.5-cp311-cp311-win32.whl
Error: No module named 'shapely.lib'

How can i do a clean installation?

@twchambers
Copy link

twchambers commented Sep 18, 2024

I had the same issue with blender 4.2. I confirmed that shapely was already installed on my system.
Rolling blendercam back to 1.0.37 fixed the issue for me.
EDIT: Nevermind, blender updated to 4.2.1 and I'm back to having the same issue.

@aak67
Copy link

aak67 commented Oct 27, 2024

I'm using release 1.0.53 with Blender 4.2.1. My workaround on my manjaro linux with manjaro shapely package installed: remove local installed shapely
rm -r $HOME/.config/blender/4.2/extensions/.local/lib/python3.12/site-packages/shapely*
or always when you start, deactivate blendercam (FABEX CNC) write in a python console window in blender
import shapely
and activate blendercam (FABEX CNC) again.
It looks like the FABEX CNC shapely package is not working properly. If the system package is loaded, the defect FABEX CNC package of shapely can't loaded any more. So FABEX CNC is running well.
By the way, you can remove FABEX CNC manually on Linux by removing the folder. Adapt the path accordingly to you Blender version.
$HOME/.config/blender/4.2/extensions/user_default/fabex
Under the path
$HOME/.config/blender/4.2/extensions/.local/lib/python3.12/site-packages/
are more files installed by FABEX CNC:

opencamlib
opencamlib.libs
opencamlib-2023.1.11.dist-info
shapely
shapely.libs
shapely-2.0.5.dist-info

@SpectralVectors
Copy link

I think this is a Python issue, I also encountered this on Arch-based Linux distros.

tldr: Download from blender.org instead of installing with your package manager on Linux distros because of Python version conflicts

Long version:
Blender officially supports Python 3.11, and only accepts Python wheels for 3.11.

3.12 released a while ago, and 3.13 is out now or soon.
Arch distros will grab the latest releases, meaning Python 3.12 or 3.13.
Blender ships from package managers without a Python binary and falls back on the system Python binary, which for Arch installs will be the latest - 3.12+, meaning it will be incompatible with all addons that ship with extra Python libraries.

This wasn't an issue before because BlenderCAM used to use a script to install dependencies via pip, which handled all version and compatibility issues, but the new method recommended by Blender is to package binary wheels compatible with Python 3.11 only and tell people to download Blender from Blender.org instead of using their package managers.

@dwrobel
Copy link

dwrobel commented Dec 12, 2024

I'm obsering the same on Fedora 41 with blender version: blender-4.2.3-2.fc41.x86_64.

An attempt to installing fabexcnc.zip v1.0.57 produces on the console the following output:

$ blender
Skipping wheel for other system (macosx_10_9_x86_64 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-macosx_10_9_x86_64.whl
Skipping wheel for other system (macosx_11_0_arm64 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-macosx_11_0_arm64.whl
Skipping wheel for other system (manylinux_2_17_aarch64.manylinux2014_aarch64 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Skipping wheel for other system (win_amd64 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-win_amd64.whl
Skipping wheel for other system (win32 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-win32.whl
Skipping wheel for other system (macosx_10_9_x86_64 != linux_x86_64): shapely-2.0.5-cp311-cp311-macosx_10_9_x86_64.whl
Skipping wheel for other system (macosx_11_0_arm64 != linux_x86_64): shapely-2.0.5-cp311-cp311-macosx_11_0_arm64.whl
Skipping wheel for other system (manylinux_2_17_aarch64.manylinux2014_aarch64 != linux_x86_64): shapely-2.0.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Skipping wheel for other system (win_amd64 != linux_x86_64): shapely-2.0.5-cp311-cp311-win_amd64.whl
Skipping wheel for other system (win32 != linux_x86_64): shapely-2.0.5-cp311-cp311-win32.whl
Traceback (most recent call last):
  File "/usr/share/blender/4.2/scripts/modules/addon_utils.py", line 407, in enable
    mod = importlib.import_module(module_name)
  File "/usr/lib64/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1022, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/home/dw/.config/blender/4.2/extensions/user_default/fabex/__init__.py", line 11, in <module>
    import shapely
  File "/home/dw/.config/blender/4.2/extensions/.local/lib/python3.13/site-packages/shapely/__init__.py", line 1, in <module>
    from shapely.lib import GEOSException  # NOQA
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'shapely.lib'
Repo module "bl_ext.user_default.fabex" not a sub-module!
addon_utils.disable: bl_ext.user_default.fabex not loaded
Skipping wheel for other system (macosx_10_9_x86_64 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-macosx_10_9_x86_64.whl
Skipping wheel for other system (macosx_11_0_arm64 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-macosx_11_0_arm64.whl
Skipping wheel for other system (manylinux_2_17_aarch64.manylinux2014_aarch64 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Skipping wheel for other system (win_amd64 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-win_amd64.whl
Skipping wheel for other system (win32 != linux_x86_64): opencamlib-2023.1.11-cp311-cp311-win32.whl
Skipping wheel for other system (macosx_10_9_x86_64 != linux_x86_64): shapely-2.0.5-cp311-cp311-macosx_10_9_x86_64.whl
Skipping wheel for other system (macosx_11_0_arm64 != linux_x86_64): shapely-2.0.5-cp311-cp311-macosx_11_0_arm64.whl
Skipping wheel for other system (manylinux_2_17_aarch64.manylinux2014_aarch64 != linux_x86_64): shapely-2.0.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Skipping wheel for other system (win_amd64 != linux_x86_64): shapely-2.0.5-cp311-cp311-win_amd64.whl
Skipping wheel for other system (win32 != linux_x86_64): shapely-2.0.5-cp311-cp311-win32.whl
Error: No module named 'shapely.lib'

On the one hand it's true that shapely is not available at the location blendercam is looking for:

$ ls -ls /home/dw/.config/blender/4.2/extensions/.local/lib/python3.13/site-packages/
total 0

On the other hand pressing Shift-F4 on blender confirms that shapely is available:

PYTHON INTERACTIVE CONSOLE 3.13.0 (main, Oct  8 2024, 00:00:00) [GCC 14.2.1 20240912 (Red Hat 14.2.1-3)]

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

>>> import shapely
>>> shapely.__version__
'2.0.6'
 
>> from shapely.lib import GEOSException
>>> 

Which matches with what I have installed on the system:

$ rpm -qv python3-shapely
python3-shapely-2.0.6-1.fc41.x86_64

I think this is a Python issue, I also encountered this on Arch-based Linux distros.

Based on my observations, I don't think so.

@SpectralVectors
Copy link

SpectralVectors commented Dec 12, 2024

Hi @dwrobel - you are having the same Python issue that I outlined above.

Note the Python version displayed by your Console - '3.13.0'
Note the Python version required by the wheels - 'cp311' - aka Python 3.11

If you want to use the addon with Python 3.13 you must source, download and install the matching wheels 'cp313' from PyPI - or use your system Python to pip install the requirements.

You are correct that it can install the wheels, and that they will display in the console, but they must match Blender's Python version in order to actually work.

To make things simpler for everyone:

  • if you install Blender with a package manager then the addon won't work without modification
  • if you download and install Blender from the Blender website it will come with Python version 3.11 and will work out of the box

If the Blender console does not display 'PYTHON INTERACTIVE CONSOLE 3.11.0' then the addon will not work.

This is a Python issue, and it has been discussed with the Blender developers - they feel that it is more important to adhere to the VFX Reference Platform which states that Python 3.11 is the only officially supported version for 2024 and 2025.

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

7 participants