Q&A

1
AttributeError: module 'numpy' has no attribute 'typeDict'

According to the trace, I find this error is generated by import scipy.optimize. I check the version of scipy anf it’s 1.3.3, which is default version on Ubuntu20.04 and it’s outdated. It can be solved by installing new version.

# update to newest version
pip3 install --upgrade scipy
# update to specific version
pip3 install scipy==1.10.1
2
BOOST_PYTHON_MODULE(libnumpy_eigen) {
  using namespace boost::python;
  import_array();
}

I got an error during compilation.

error: void function 'init_module_libnumpy_eigen' should not return a value [-Wreturn-type]
  import_array();

Change code like below

BOOST_PYTHON_MODULE(libnumpy_eigen) {
  using namespace boost::python;
  _import_array();
}

or

BOOST_PYTHON_MODULE(libnumpy_eigen) {
  using namespace boost::python;
  if(_import_array() < 0) 
  {
    return nullptr;
  }
}
3
ConnectionResetError: [Errno 104] Connection reset by peer
4
AttributeError: 'ForkAwareLocal' object has no attribute 'connection'