MemoryError GPT-4 code interpreter: chatgpt and api

I’m having an issue with the code interpreter. At first it failed to load files, then I realized it might be a more generalized issue with importing libraries like pandas, numpy, matplotlib etc, since it works when I ask it to only print “hello world”.

MemoryError. It also happens with the API and with the Palyground using the assistants.

OpenBLAS blas_thread_init: pthread_create failed for thread 16 of 32: Resource temporarily unavailable
Exception ignored in: <bound method IPythonKernel._clean_thread_parent_frames of <ipykernel.ipkernel.IPythonKernel object at 0x7ee571fe4c20>>
Traceback (most recent call last):
  File "/home/sandbox/.local/lib/python3.11/site-packages/ipykernel/ipkernel.py", line 775, in _clean_thread_parent_frames
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 17 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 18 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 19 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 20 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 21 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 22 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 23 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 24 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 25 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 26 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 27 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 28 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 29 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 30 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 31 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
    def _clean_thread_parent_frames(

KeyboardInterrupt: 
Unexpected exception formatting exception. Falling back to standard exception
Traceback (most recent call last):
  File "/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/interactiveshell.py", line 3577, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "/tmp/ipykernel_12/3303771377.py", line 1, in <module>
    import matplotlib.pyplot as plt
  File "/home/sandbox/.local/lib/python3.11/site-packages/matplotlib/__init__.py", line 108, in <module>
    import numpy
  File "/home/sandbox/.local/lib/python3.11/site-packages/numpy/__init__.py", line 152, in <module>
    from . import random
  File "/home/sandbox/.local/lib/python3.11/site-packages/numpy/random/__init__.py", line 180, in <module>
    from . import _pickle
  File "/home/sandbox/.local/lib/python3.11/site-packages/numpy/random/_pickle.py", line 1, in <module>
    from .mtrand import RandomState
  File "mtrand.pyx", line 1, in init numpy.random.mtrand
  File "bit_generator.pyx", line 1, in init numpy.random.bit_generator
ImportError: /home/sandbox/.local/lib/python3.11/site-packages/numpy/random/_common.cpython-311-x86_64-linux-gnu.so: failed to map segment from shared object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/interactiveshell.py", line 2168, in showtraceback
    stb = self.InteractiveTB.structured_traceback(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/ultratb.py", line 1457, in structured_traceback
    return FormattedTB.structured_traceback(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/ultratb.py", line 1348, in structured_traceback
    return VerboseTB.structured_traceback(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/ultratb.py", line 1195, in structured_traceback
    formatted_exception = self.format_exception_as_a_whole(etype, evalue, etb, number_of_lines_of_context,
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/ultratb.py", line 1085, in format_exception_as_a_whole
    self.get_records(etb, number_of_lines_of_context, tb_offset) if etb else []
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/ultratb.py", line 1182, in get_records
    res = list(stack_data.FrameInfo.stack_data(etb, options=options))[tb_offset:]
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sandbox/.local/lib/python3.11/site-packages/stack_data/core.py", line 597, in stack_data
    yield from collapse_repeated(
  File "/home/sandbox/.local/lib/python3.11/site-packages/stack_data/utils.py", line 83, in collapse_repeated
    yield from map(mapper, original_group)
  File "/home/sandbox/.local/lib/python3.11/site-packages/stack_data/core.py", line 587, in mapper
    return cls(f, options)
           ^^^^^^^^^^^^^^^
  File "/home/sandbox/.local/lib/python3.11/site-packages/stack_data/core.py", line 551, in __init__
    self.executing = Source.executing(frame_or_tb)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sandbox/.local/lib/python3.11/site-packages/executing/executing.py", line 264, in executing
    source = cls.for_frame(frame)
             ^^^^^^^^^^^^^^^^^^^^
  File "/home/sandbox/.local/lib/python3.11/site-packages/executing/executing.py", line 183, in for_frame
    return cls.for_filename(frame.f_code.co_filename, frame.f_globals or {}, use_cache)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sandbox/.local/lib/python3.11/site-packages/executing/executing.py", line 212, in for_filename
    return cls._for_filename_and_lines(filename, tuple(lines))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sandbox/.local/lib/python3.11/site-packages/executing/executing.py", line 223, in _for_filename_and_lines
    result = source_cache[(filename, lines)] = cls(filename, lines)
                                               ^^^^^^^^^^^^^^^^^^^^
  File "/home/sandbox/.local/lib/python3.11/site-packages/executing/executing.py", line 163, in __init__
    self.tree = ast.parse(self.text, filename=filename)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/ast.py", line 50, in parse
    return compile(source, filename, mode, flags,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MemoryError
6 Likes

I’m seeing the same. Out of resources on the OpenAI side :frowning:

2 Likes

Same happening for me in the Playground

1 Like

Same happening with me.
Showing similar error -
STDOUT/STDERR
OpenBLAS blas_thread_init: pthread_create failed for thread 17 of 32: Resource temporarily unavailable
Exception ignored in: <bound method IPythonKernel._clean_thread_parent_frames of <ipykernel.ipkernel.IPythonKernel object at 0x7ee7b75f88e0>>
Traceback (most recent call last):
File “/home/sandbox/.local/lib/python3.11/site-packages/ipykernel/ipkernel.py”, line 775, in _clean_thread_parent_frames
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 18 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 19 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 20 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max

1 Like

Same here, gpt can’t execute any python code anymore

1 Like

Same here. I was the code interpreter to get back insights from a csv file. It failed to run. Updated the file to reduce the file size. No luck. Gave the same memory error.

1 Like

Same here. I’ve been encountering this error since the beginning of my day.

1 Like

Not alone, I faced with this trouble from today.

1 Like

Same for me, does anyone know when it will be fixed ?

1 Like

When I try to upload an excel file of 600 KB I get the below repsonse when I ask what the problem is.
Yes — your file upload was successful just now (XXXXX.xlsx), and I can confirm I do have access to it.
However, the issue is not with file uploads, but with system memory limits in the environment used for processing Excel files. This is causing failures when trying to load or manipulate large datasets — particularly during filtering or preview steps

1 Like

Last Friday, I was processing some tasks in the same file, and it worked like a charm. So, it is definitely something that started afterward. Unfortunately, it is very hard to get in contact with OpenAI customer support.
Paying $200 a month and receiving such poor service and customer response is truly embarrassing.

3 Likes

Got the same issue here. It just worked a moment ago, and when I asked to edit it 1 tiny bit, it stopped working and kept getting errors, even after succesfully doing the analysis.

Traceback (most recent call last):
File “/home/sandbox/.local/lib/python3.11/site-package/IPython/core/interactiveshell.py”, line 3577, in run_code
File “/tmp/ipykernel_411/21400972.py”, line 1, in
File “/home/sandbox/.local/lib/python3.11/site-packages/pandas/_.py”, line 11, in
File “”, line 1176, in _find_and_load
File “”, line 1147, in _find_and_load_unlocked
File “”, line 690, in _load_unlocked
File “”, line 936, in exec_module
File “”, line 1032, in get_code
File “”, line 1131, in get_data
MemoryError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/interactiveshell.py”, line 2168, in showtraceback
File “/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/ultratb.py”, line 1457, in structured_traceback
File “/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/ultratb.py”, line 1348, in structured_traceback
File “/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/ultratb.py”, line 1195, in structured_traceback
File “/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/ultratb.py”, line 1085, in format_exception_as_a_whole
File “/home/sandbox/.local/lib/python3.11/site-packages/IPython/core/ultratb.py”, line 1153, in get_records
File “/usr/local/lib/python3.11/inspect.py”, line 991, in getmodule
MemoryError

1 Like

I’m having this error as well. It was working yesterday. Please let me know if it’s fixed.

OpenBLAS blas_thread_init: pthread_create failed for thread 17 of 32: Resource temporarily unavailable
Exception ignored in: <bound method IPythonKernel._clean_thread_parent_frames of <ipykernel.ipkernel.IPythonKernel object at 0x7eaaa2334f20>>
Traceback (most recent call last):
  File "/home/sandbox/.local/lib/python3.11/site-packages/ipykernel/ipkernel.py", line 775, in _clean_thread_parent_frames
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 18 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 19 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 20 of 32: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max

Same here not working in ChatGPT 4o.

1 Like

forcing the following fixed the issue for me

import os
os.environ[‘OPENBLAS_NUM_THREADS’] = ‘1’

3 Likes

I’m facing the same problem! Where are the skilled people to fix this?

2 Likes

Where did you write that code? In my case I’m using custom GPT with Code Interpreter.

I think you need to ask chatgpt in the prompt to execute this command when you attach a file or manipulate it. works for me

One option is to modify your instructions and ask you custom GPT to always run the following code when using Code Interpreter

1 Like

Same for me, does anyone have any idea if they are fixing the issue?

2 Likes