Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/python3.9/lib-dynload/resource.cpython-39-x86_64-linux-gnu.so: undefined symbol: PyFloat_Type #494

Open
BookaiJin opened this issue Sep 6, 2023 · 3 comments

Comments

@BookaiJin
Copy link

Describe the bug
lib/python3.9/lib-dynload/resource.cpython-39-x86_64-linux-gnu.so: undefined symbol: PyFloat_Type

To Reproduce
MEMORY_LIMIT_CODE = "import resource\n" +
"\n" +
"soft, hard = resource.getrlimit(resource.RLIMIT_AS)\n" +
"resource.setrlimit(resource.RLIMIT_AS, (maxSize, hard))";
interceptor.set("maxSize", maxMemorySize);
interceptor.exec(MEMORY_LIMIT_CODE);

Expected behavior
limit python code memory usage

Environment (please complete the following information):

  • OS Platform, Distribution, and Version: RedHat 7.9
  • Python Distribution and Version: python3.9.12
  • Java Distribution and Version: 1.8.151
  • Jep Version: 4.1.1
  • Python packages used (e.g. numpy, pandas, tensorflow): resource
@BookaiJin
Copy link
Author

I have ./configure --enbale-shared when install python

@BookaiJin BookaiJin reopened this Sep 6, 2023
@BookaiJin
Copy link
Author

if I don't use resource
when I use pandas
I got this error and then my java program crash

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

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.9 from "/usr/local/bin/python3"
  • The NumPy version is: "1.25.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: /opt/python/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-x86_64-linux-gnu.so: undefined symbol: PyObject_SelfIter

pytz: /opt/python/lib/python3.9/lib-dynload/math.cpython-39-x86_64-linux-gnu.so: undefined symbol: PyFloat_Type

@bsteffensmeier
Copy link
Member

An undefined symbol typically means that something went wrong loading libpython. The simplest workaround is to set the env var LD_PRELOAD to the location of the libpython which contains the missing symbol. On your system I think that would be '/usr/local/lib/libpython3.9.so'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants