安装pandas inn graalpython时遇到错误

问题描述

当我编译 graalpython -m ginstall install pandasgraalpython -m ginstall install bumpy 我收到以下错误,请评论如何修复错误。谢谢。

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

解决方法

您似乎混合了默认系统 python 安装的软件包和 graalpython 安装的软件包。默认情况下,graalpython 与 CPython (~/.local/lib/python3.8/site-packages/) 安装到同一个站点范围的目录中。

解决此问题的最简单方法是使用 GraalPython 支持的 venv。例如:

$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
,

发现~/.bash_profile里面有很多环境变量。我评论了所有这些并成功编译了 numpy/pandas。顺便问一下,我如何验证 gcc/clang 的设置是否正确?不管怎样,谢谢你的帮助。

#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"