Error with shapely

Problem description:

Traceback (most recent call last):
  File "main.py", line 15, in <module>
    from shapely.geometry import LineString
  File "/home/runner/hanoi-4-disk-step-ion/venv/lib/python3.8/site-packages/shapely/geometry/__init__.py", line 4, in <module>
    from .base import CAP_STYLE, JOIN_STYLE
  File "/home/runner/hanoi-4-disk-step-ion/venv/lib/python3.8/site-packages/shapely/geometry/base.py", line 20, in <module>
    from shapely.coords import CoordinateSequence
  File "/home/runner/hanoi-4-disk-step-ion/venv/lib/python3.8/site-packages/shapely/coords.py", line 10, in <module>
    from shapely.geos import lgeos
  File "/home/runner/hanoi-4-disk-step-ion/venv/lib/python3.8/site-packages/shapely/geos.py", line 83, in <module>
    CDLL(geos_whl_so[0])
  File "/nix/store/5g6y3nzq80fkq54ahan2slc57j6327nj-python3-3.8.15/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libstdc++.so.6: cannot open shared object file: No such file or directory

Repl link:

Install the libstdc++ package since it says there’s no such file or directory

Or create a requirements.txt with Shapely==1.7.1 in it to see if it resolve the libstdc++.so.6 errors

1 Like

NO use :
requirements.txt with Shapely==1.7.1


Please tell me how to Install the libstdc++ package

you can try setting the LD_LIBRARY_PATH environment variable to include the directory where the libstdc++.so.6 library is located. Assuming the library is in the /usr/lib directory

export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
this command would do that, (had to look it up)

1 Like

export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

where I put above environment variable ?

Thank you.
It works.

Oh, shoot, i’m sorry I didn’t respond, I fell asleep ;-; and forgot about the post in the morning/ I’m glad it works though.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.