1

When I compile graalpython -m ginstall install pandas or graalpython -m ginstall install bumpy I got the following error, please comment how to fix the error. Thank you.

line 54, in __init__
  File "number.c", line 284, in array_power
  File "ufunc_object.c", line 4688, in ufunc_generic_call
  File "ufunc_object.c", line 3178, in PyUFunc_GenericFunction
  File "ufunc_type_resolution.c", line 180, in PyUFunc_DefaultTypeResolver
  File "ufunc_type_resolution.c", line 2028, in linear_search_type_resolver
  File "ufunc_type_resolution.c", line 1639, in ufunc_loop_matches
  File "convert_datatype.c", line 904, in PyArray_CanCastArrayTo
java.lang.AssertionError
Steves
  • 2,798
  • 21
  • 21
madeinQuant
  • 1,721
  • 1
  • 18
  • 29
  • This almost looks like a bug worth reporting at https://github.com/oracle/graalpython. You can try running with `--experimental-options --python.WithJavaStacktrace=2` (that would be `graalpython --experimental-options --python.WithJavaStacktrace=2 -m ginstall ...`) to see if you can get Java stack trace out of that error. P.S.: please add some basic info like you system OS, version, GraalVM version, etc. – Steves Feb 01 '21 at 09:33
  • @Steves Thanks for your help, I try running `graalpython --experimental-options --python.WithJavaStacktrace=2 -m ginstall install numPy or pandas`, encountered same errors. – madeinQuant Feb 01 '21 at 10:16
  • So you did not get any Java stack trace? – Steves Feb 01 '21 at 10:32
  • @Steves, I didn't. To be honest, I don't know what is Java stack trace. – madeinQuant Feb 01 '21 at 10:38

2 Answers2

1

It seems that you may be mixing packages installed by your default system python and those installed by graalpython. By default graalpython installs into the same site-wide directory as CPython (~/.local/lib/python3.8/site-packages/).

The simplest way to fix this is to use venv, which GraalPython supports. For example:

$GRAALVM_HOME/bin/graalpython -m venv /path/to/my/new/venv
. /path/to/my/new/venv/bin/activate
python -c 'import platform; print(platform.python_implementation())'
# output: GraalVM
python -m ginstall install pandas
# to end the venv session:
deactivate
python -c 'import platform; print(platform.python_implementation())'
# output: CPython
Steves
  • 2,798
  • 21
  • 21
1

I found that there are a lot of environment variables in ~/.bash_profile. I comment all of them and compile numpy/pandas successfully. By the way, how do I verify the settings of gcc/clang is correct? Anyway, thank you for your help.

#export CC=/usr/local/Cellar/gcc/10.1.0/bin/gcc-10
#export CXX=/usr/local/Cellar/gcc/10.1.0/bin/g++-10

#export CC=/usr/bin/clang
#export CXX=/usr/bin/clang++

#export C_INCLUDE_PATH=/usr/local/Cellar/libiomp/20150701/include/libiomp:$C_INCLUDE_PATH
#export CPLUS_INCLUDE_PATH=/usr/local/Cellar/libiomp/20150701/include/libiomp/:$CPLUS_INCLUDE_PATH
#export LIBRARY_PATH=/usr/local/Cellar/libiomp/20150701/lib:$LIBRARY_PATH
#export DYLD_LIBRARY_PATH=/usr/local/Cellar/libiomp/20150701/lib:$DYLD_LIBRARY_PATH

#export MPICXX=mpicxx
#export LDFLAGS="-pthread -lm"
#export CFLAGS="-Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -fopenmp"
madeinQuant
  • 1,721
  • 1
  • 18
  • 29