[Python] import gensim binary incompatibility

Discussão em 'Python' iniciado por Stack, Abril 25, 2025.

  1. Stack

    Stack Membro Participativo

    import gensim
    import numpy
    import scipy
    print("gensim version:", gensim.__version__)
    print("numpy version:", numpy.__version__)
    print("scipy version:", scipy.__version__)

    ValueError Traceback (most recent call last)
    <ipython-input-17-4e23b2e74105> in <cell line: 0>()
    ----> 1 import gensim
    2 import numpy
    3 import scipy
    4 print("gensim version:", gensim.__version__)
    5 print("numpy version:", numpy.__version__)

    13 frames
    /usr/local/lib/python3.11/dist-packages/numpy/random/_pickle.py in <module>
    ----> 1 from .mtrand import RandomState
    2 from ._philox import Philox
    3 from ._pcg64 import PCG64, PCG64DXSM
    4 from ._sfc64 import SFC64
    5

    numpy/random/mtrand.pyx in init numpy.random.mtrand()

    ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject


    although


    !pip show gensim


    worked perfectly

    I have trouble with neither in VSCode

    When I tried installing gensim, pip flagged a package incompatibility, it has something to do with fastai,thinc,spacy but I couldn't find those packages in VSCode. I uninstalled thinc, spaCy, and fastai, assuming they weren't related to gensim.

    by the way libraries version in VSCode are

    gensim version: 4.3.3

    numpy version: 1.26.4

    scipy version: 1.13.1

    Continue reading...

Compartilhe esta Página