Trouble Installing Shapely Library on OpenWRT Linux Without Pip Support

63 Views Asked by At

I'm facing difficulties while trying to install the Shapely library on an OpenWRT Linux x86 version where I cannot use pip due to lack of support. The Python version available is 3.9. My objective is to use Shapely, and I've attempted the following methods:

  1. Downloaded the shapely-2.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl file, extracted it, and copied both the shapely and shapely.libs folders. This approach has worked for other libraries, but it results in the following error:
from .lib import GEOSException  # NOQA
ModuleNotFoundError: No module named 'shapely.lib'

I noticed that it's looking for the file lib.cpython-39-x86_64-linux-gnu.so, so I renamed it to lib.so. However, when I rerun the Python script, I encounter this error:

ImportError: /rwdata/opt/gt/adv_libs/shapely/lib.so: wrong ELF class: ELFCLASS64

Even though the filename suggests x86_x64, it seems to have an ELF class issue.

  1. Tried with an older version, Shapely 1.7.1, which has a different structure and doesn't give the shapely.lib error. However, it raises the following error:
OSError: /rwdata/opt/gt/adv_libs/Shapely.libs/libgeos_c-a68605fd.so.1.13.1: wrong ELF class: ELFCLASS64
  1. Attempted to install from the source using the setup.py install command, but it fails due to the absence of setuptools, which cannot be installed.

Am I overlooking any steps or making any mistakes in this installation process? Any guidance on how to successfully install the Shapely library in this environment would be greatly appreciated.

EDIT: Linux version is x86

0

There are 0 best solutions below