shapely / shapely

Manipulation and analysis of geometric objects
https://shapely.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
3.84k stars 564 forks source link

Memory Error #1482

Open HaSHsss opened 2 years ago

HaSHsss commented 2 years ago

CentOS Linux 7 (Core) last shapely version installed from pip

i have error

     from shapely.geometry import *
   File "/home/sms1161/.local/lib/python3.8/site-packages/shapely/geometry/__init__.py", line 4, in <module>
     from .base import CAP_STYLE, JOIN_STYLE
   File "/home/sms1161/.local/lib/python3.8/site-packages/shapely/geometry/base.py", line 20, in <module>
     from shapely.coords import CoordinateSequence
   File "/home/sms1161/.local/lib/python3.8/site-packages/shapely/coords.py", line 10, in <module>
     from shapely.geos import lgeos
   File "/home/sms1161/.local/lib/python3.8/site-packages/shapely/geos.py", line 303, in <module>
     error_h = EXCEPTION_HANDLER_FUNCTYPE(error_handler)
 MemoryError
sgillies commented 2 years ago

@HaSHsss can you provide more information? In what context does the error occur?

mwtoews commented 2 years ago

CentOS 7 has Python 3.6, but you seem to have a non-standard install. How did you install Python? Do you recall if the pip command installed binary wheels, or did you install it using geos-devel?

HaSHsss commented 2 years ago

can you provide more information? In what context does the error occur?

The error occurs immediately after importing the module. from shapely.geometry import *

Now I have installed the new version 1.8.3. did not help.

HaSHsss commented 2 years ago

CentOS 7 has Python 3.6, but you seem to have a non-standard install. How did you install Python? Do you recall if the pip command installed binary wheels, or did you install it using geos-devel?

My project is hosted I don't have permission to install or edit the web server settings in any way.

I install with SSH pip install Shapely --user

HaSHsss commented 2 years ago

The problem is more interesting than it seems. Because of this error, I am getting error 500 But, if I just connect to the hosting via SSH (without entering any commands), then my site starts working without errors. Right now I keep the SSH connection open 24 hours a day. 7689

sgillies commented 2 years ago

@HaSHsss I think your problem may be related to https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/6184. Shapely's EXCEPTION_HANDLER_FUNCTYPE also uses ctypes CFUNCTYPE. I don't think we can help you with this, it will take some system administration work.

HaSHsss commented 2 years ago

@HaSHsss I think your problem may be related to https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/6184. Shapely's EXCEPTION_HANDLER_FUNCTYPE also uses ctypes CFUNCTYPE. I don't think we can help you with this, it will take some system administration work.

It describes a bug with TEMPDIR which is fixed in Python 3.8 Perhaps I missed something

smidm commented 1 year ago

I encountered the same error and it was caused by full /tmp filesystem.