This answer might be delayed, but i believe the most simple way to resolve this is to downgrade scipy to certain older version (for me scipy==1.6.2 is good). This is simply because both _status_message and wrap_function were removed from scipy.optimize.optimize in recent version of scipy.