Issue 1:
Reproducing code example:

import matplotlib.pyplot as plt;

Before this happened I was running a different python script, which used 89 processes. Unfortunately I cannot share that script publicly. Since then numpy crashes after import immediately.

Error message:

OpenBLAS blas_thread_init: pthread_create failed for thread 52 of 64: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 4096 current, 1028736 max
OpenBLAS blas_thread_init: pthread_create failed for thread 53 of 64: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 4096 current, 1028736 max
OpenBLAS blas_thread_init: pthread_create failed for thread 54 of 64: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 4096 current, 1028736 max
OpenBLAS blas_thread_init: pthread_create failed for thread 55 of 64: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 4096 current, 1028736 max
OpenBLAS blas_thread_init: pthread_create failed for thread 56 of 64: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 4096 current, 1028736 max
OpenBLAS blas_thread_init: pthread_create failed for thread 57 of 64: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 4096 current, 1028736 max
OpenBLAS blas_thread_init: pthread_create failed for thread 58 of 64: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 4096 current, 1028736 max
OpenBLAS blas_thread_init: pthread_create failed for thread 59 of 64: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 4096 current, 1028736 max
OpenBLAS blas_thread_init: pthread_create failed for thread 60 of 64: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 4096 current, 1028736 max
OpenBLAS blas_thread_init: pthread_create failed for thread 61 of 64: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 4096 current, 1028736 max
OpenBLAS blas_thread_init: pthread_create failed for thread 62 of 64: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 4096 current, 1028736 max
OpenBLAS blas_thread_init: pthread_create failed for thread 63 of 64: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 4096 current, 1028736 max
Traceback (most recent call last):
File "/usr/local/lib64/python3.6/site-packages/numpy/core/__init__.py", line 17, in <module>
from . import multiarray
File "/usr/local/lib64/python3.6/site-packages/numpy/core/multiarray.py", line 14, in <module>
from . import overrides
File "/usr/local/lib64/python3.6/site-packages/numpy/core/overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: PyCapsule_Import could not import module "datetime"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "temp.py", line 1, in <module>
import matplotlib.pyplot as plt;
File "/usr/local/lib64/python3.6/site-packages/matplotlib/__init__.py", line 138, in <module>
from . import cbook, rcsetup
File "/usr/local/lib64/python3.6/site-packages/matplotlib/cbook/__init__.py", line 31, in <module>
import numpy as np
File "/usr/local/lib64/python3.6/site-packages/numpy/__init__.py", line 142, in <module>
from . import core
File "/usr/local/lib64/python3.6/site-packages/numpy/core/__init__.py", line 47, in <module>
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
1. Check that you expected to use Python3.6 from "/usr/bin/python3",
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy version "1.17.2" you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: PyCapsule_Import could not import module "datetime"

zsh: segmentation fault python3 temp.py

Numpy/Python version information:

numpy-1.7.1-13.el7.x86_64

Issue 2:
Related to vscode-restructuredtext/snooty-parser#24 and networkx/networkx#4857

I expect import numpy to commit close to 0 memory.

Reproducing code example:

import numpy as np

Error message:

File "C:\Users\Ark\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\__init__.py", line 153, in <module>
from . import ma
File "C:\Users\Ark\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\ma\__init__.py", line 42, in <module>
from . import core
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 724, in exec_module
File "<frozen importlib._bootstrap_external>", line 818, in get_code
File "<frozen importlib._bootstrap_external>", line 917, in get_data
MemoryError

NumPy/Python version information:

1.19.5 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]