ChatGPT can no longer read geodata (polygons)

I’v used geographical data (geodata, e.g. ESRI Shape, GeoPackage etc) hundreds of times in ChatGPT-4 Plus/Team, but since recently, ChatGPT no longer can read polygon data. From what I understand, it seems to be an issue with the loaded libraries. I rely completely on this feature (geospatial data handling) in ChatGPT. Any ideas on workarounds? Thanks!
File ~/.local/lib/python3.11/site-packages/shapely/geometry/polygon.py:300, in Polygon.array_interface(self)

  • 298 @property*
  • 299 def array_interface(self):*
    → 300 raise NotImplementedError(
  • 301 “A polygon does not itself provide the array interface. Its rings do.”)*

NotImplementedError: A polygon does not itself provide the array interface. Its rings do.

It looks like Python was updated from the last I checked:
The notebook environment is currently running Python version 3.11.8, and the version of the Shapely library used for geodata is 1.7.1. ​​

Somewhat sure it was Python 3.8 when I last noticed the version a week ago. (the ChatGPT chats not even being dated and changing position when just the title is edited is a real headache to find an earlier report…)

The shapely library was 1.7.1 also on February 18 when I did a dump of all the python modules in the sandbox.

I did attempt to install this package locally (windows & Python 3.11.x) just from the pip wheel. It barfed on a binary.

C:\WINDOWS\system32>pip install shapely==1.7.1
Collecting shapely==1.7.1
Downloading Shapely-1.7.1.tar.gz (383 kB)
---------------------------------------- 383.2/383.2 kB 2.4 MB/s eta 0:00:00
Preparing metadata (setup.py) … error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
Traceback (most recent call last):
File “”, line 2, in
File “”, line 34, in
File “…\Temp\pip-install-oco6h9da\shapely_d944ff595408498ebfd4fec9344e88cf\setup.py”, line 85, in
from shapely.buildcfg import geos_version_string, geos_version,
File “…\Temp\pip-install-oco6h9da\shapely_d944ff595408498ebfd4fec9344e88cf\shapely_buildcfg.py”, line 205, in
lgeos = CDLL(“geos_c.dll”)
^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\ctypes_init
.py", line 376, in init
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: Could not find module ‘geos_c.dll’ (or one of its dependencies). Try using the full path with constructor syntax.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

So I don’t have an idea what has changed, but people definitely do not like this ChatGPT GPT-4 for doing anything productive, and it could be just plain coding wrong if you are having code written on demand.

Thanks, you’re right. It has something to do with a change in the Python environment. I just confirmed the version numbers.​
The version of Python that is currently running is 3.11.8. ​
The version of Shapely that is currently running is 1.7.1.

Unfortunately, this makes ChatGPT currently pretty useless for me and I have no idea if it’s going to be fixed or if this is the ‘new normal’ state.

Looks like old version of this library plus new numpy will raise similar errors.

Numpy is now 1.24.0 in the notebook. It was 1.21.2 in February. I couldn’t even build older than 1.22 on Python 3.11.

The AI also reports: GEOS appears to be available in the current environment, with the library found at libgeos_c.so.1. However, the exact version of GEOS cannot be determined directly through this method.

The challenge is also in supported versions vs what the AI can effectively code for if you did request an upgrade.

  • Shapely 2.0.0 (2022-12)
  • Shapely 1.8.5 (2021-10) will support only Python versions >= 3.6"
  • Shapely 1.7 (2020-01) requires Python 2.7, >=3.5 GEOS >=3.3
Don't read this if you don't want ideas and a headache...

The current Python notebook sandbox environment is as follows:

  • Operating System: Linux
  • OS Release: 4.4.0
  • OS Version: #1 SMP Sun Jan 10 15:06:54 PST 2016
  • Machine Architecture: x86_64
  • Processor: (Not specified)
  • Python Version: 3.11.8
  • Python Implementation: CPython
  • Python Build: main, Feb 13 2024 09:58:12
  • Python Compiler: GCC 12.2.0
  • IPython Version: 8.22.1

To ensure compatibility with the current Python notebook sandbox when building a version of numpy on a separate system, you should target Python 3.11.8, preferably built with GCC 12.2.0, on a Linux x86_64 architecture. The build details, including the exact build timestamp and the Python implementation, may also be relevant depending on the specificity of your compatibility requirements.

1 Like

Thanks @_j ! Just now, my sandbox notebook reports these versions (until a couple of hours ago, python was 3.11.8). Polygons geospatial data still not working, though :frowning:

  • Python: 3.8.10
  • Shapely: 1.7.1
  • GeoPandas: 0.10.2
1 Like

After initially receiving a response from OpenAI support stating that further investigation on their part was required, today I received a generic reply advising me to restart my browser, among other basic suggestions. This means I’m back to square one with the support process, and I’m very disappointed with this outcome.

OpenAI support often provides general - sometimes what you are looking for on help sites - answers.

Suggestions such as restarting your browser or deleting cookies may back this up.

If so, the OpenAI support probably automatically responds to the help site content as the initial answer, perhaps for efficiency.

I mean, isn’t there no need to assume that you are “back to square one”?
Didn’t updating the geopandas or shapely modules make any difference?

Thanks @dignity_for_all Outside the sandbox environment (i.e. in my Jupyter notebooks) everything works fine and I can run my scripts. My point is that this used to work in the ChatGPT python sandbox, out of the box. This has been quite an advantage, to actually have ChatGPT run its own scripts (creating maps, in this case).

Do you mean that I, as a ChatGPT-UI user, can influence which versions of Python libraries the sandbox should use? I haven’t been able to prompt that, it just says this is pre-configured.

The Python version on the ChatGPT sandbox (code interpreter) appears to be 3.11.8, geopandas is 0.10.2, and shapely is 1.7.1.

The Python module for ChatGPT is located at /home/sandbox/.local/lib/python3.11/site-packages/, but seeing the message /.local/lib/python3.11/site-packages/ at the beginning, I had misunderstood that it was about a non-ChatGPT environment.

ChatGPT users cannot influence dependencies on Python module versions on ChatGPT.
So it seems that you have to wait for changes in the environment on ChatGPT to resolve the dependencies.

My apologies for not understanding your intent.

1 Like

@dignity_for_all No problem at all, thank you for the feedback and engagement. It has been a great advantage for non-GIS (Geographic Information Systems) users to be able to work with geographic data gathered in a single tool. Now, we have to ask ChatGPT instead to generate the Python scripts and run them elsewhere. However, I haven’t read about anyone else having issues with this, which might mean that the use case is not that big…

Different people use ChatGPT for different purposes, so specific use case might not be big enough…

But I think that asking ChatGPT to generate the code and resolving the dependencies on another environment (like Jupyter notebook, although I’m not familiar with geopandas, shapely, or non-GIS) will work.

I’m not sure this will help, and even if the Python module could be installed in ChatGPT’s code interpreter, it would only be for that conversation session, but I provide this link in case it helps.

Thank you very much for the suggestion, @dignity_for_all but my challenge is also that I need to make it work not just for myself, but for all participants in the AI courses I teach. I will try it out, though :slight_smile:

1 Like

And as I hinted at in my “headache” you can expand - numpy is heavily binary, and even getting a compiled version over to the sandbox with only .zip would need some chmodding. The most determined could possibly get it done, as in the past, even pypi wheels have been unpacked and run.

It is odd that you were temporarily reverted to 3.8, as if there were still other OS deployment images floating around in OpenAI. There is no alternate Python install in the 3.11 sandbox.

If the goal is giving others an AI solution, and preparing them for an AI world, you may want to write your own function-based code interpreter sandbox (actually tool) using the API models (pay-per-use). You can dump out the ## python function text that is part of the ChatGPT prompt as an idea of how it works, put that # Tools section into your own system message on the API, and then get the chat completions AI to emit Python directly to you as a function call (which also needs a dummy function to turn on API function-handling). You then write your own notebook code interpreter to run the code.

2 Likes

Thanks @_j for the brilliant suggestion and workflow/workaround. I asked ChatGPT abot the last update: “The code interpreter sandbox environment was last updated on March 12, 2024, at 11:41:52 UTC. This update included several key changes, aimed at enhancing performance, security, and compatibility with a range of Python packages critical for data science and geographical information systems (GIS) applications. However, without direct access to the update logs or detailed change documentation specific to the environment’s infrastructure, I can only infer the general nature of updates based on the Python, GeoPandas, and Shapely versions provided.”

Hi!

There is a official integration for Jupiter notebooks. You probably know this already but it could be a straightforward solution.

1 Like