ImportError: rknn/api/rknn_base.cpython-35m-x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf

After I installed rknn toolkit successfully on my PC (ubuntu 18.04 LTS), try to import rknn.api the following error message shows up:

ImportError: rk3399pro/lib/python3.5/site-packages/rknn/api/rknn_base.cpython-35m-x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf

Follow recommendations from RKNN toolkit trouble shootings and still doesn’t work.

Found the reasons why here, but no clue how to fix it.

Anybody has the same issue? Please help. Thanks a lot.

after a long hours of investigation, it turns out the python3.5 I installed without fpectl turn on

So the solution is a little bit involved but works: I need to reconfigure/recompile the python3.5 --with-fpectl enabled, the following are the step by step process works on my machine:

cd /usr/src
sudo wget https://www.python.org/ftp/python/3.5.9/Python-3.5.9.tgz
cd Python-3.5.9
sudo ./configure --enable-optimizations --with-fpectl
sudo make altinstall

then reinstall rknn toolkit using the newly compiled/installed python3.5

P.S. python3.5 is old and not supported anymore, I wish rknn toolkit can support python3.6 or later soon… ; ))