Reputation: 1813
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
Upvotes: 2
Views: 326
Reputation: 3234
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
Edit: GraalPy specific ginstall
package is deprecated in favor of using vanilla pip
just like on CPython: python -m pip install pandas
should work on GraalPy.
Upvotes: 1
Reputation: 1813
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"
Upvotes: 1