Python warning numpy.dtype size changed, may indicate binary incompatibility

After update of python version (from 3.5 to 3.6) and brand new virtual environment I got error :

RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
from .tslib import iNaT, NaT, Timestamp, Timedelta, OutOfBoundsDatetime

No code changes, no new modules or requirements.

After quick research on the web I found solution:

  1. Activate your virtual environment if you use any.
  2. Run command:
pip install --no-binary pandas -I pandas

The module pandas is build on different version of numpy. The solution above is rebuilding pandas based on the local numpy.

Note: The warning is not blocking or stopping program execution.

Another possible solution could be:

pip uninstall -y scipy scikit-learn
pip install --no-binary scipy scikit-learn

Related Article