numpy undefined symbol: PyFPE_jbuf

36,373

Solution 1

I had the same problem, probably you have installed numpy without Anaconda, so there is a conflict because of this, which numpy to use: that one installed with pip or with conda. When I removed non-Anaconda numpy, error gone.

pip uninstall numpy

Solution 2

For cython users:

This post was helpful. The post explains, that there is some flag (--with-fpectl), which is either set during the compilation of cpython or not. When a library has been compiled using a cpython without that flag, it is incompatible to a version with that flag being set. This effect does only show up when you use cython, as numpy itself does not use this extension.

As further stated in that post, my Ubuntu 16.04 has been created with this flag and Conda without it. For me, it was specifically the module hmmlearn throwing the undefined symbol error. This must be the case because it was shipped by Ubuntu with the flag being set and not by anaconda. So I uninstalled hmmlearn and manually installed it anew from sourcescode (Anaconda, unfortunately, does not offer hmmlearn). --> Works!

Solution 3

irony at it's best, i restarted my laptop without doing nothing, and it worked. Can't understand why.

Solution 4

I agree with previous posts that this seems to be caused by having multiple versions of numpy installed. For me, it wasn't enough to just use pip, as I also had multiple versions of pip installed.

Specifying the specific pip solved the problem:

/usr/bin/pip3 uninstall numpy
Share:
36,373

Related videos on Youtube

frammnm
Author by

frammnm

Updated on April 11, 2020

Comments

  • frammnm
    frammnm about 4 years

    I am trying to use the One Million Song Dataset, for this i had to install python tables, numpy, cython, hdf5, numexpr, and so.

    Yesterday i managed to install all i needed, and after having some troubles with hdf5, i downloaded the precompiled binary packages and saved them in my /bin folder, and the respective libraries in /lib , after that i tested this python script : http://labrosa.ee.columbia.edu/millionsong/sites/default/files/tutorial1.py.txt

    and it worked fine, to be clear the way i made it work was to first run the script and start installing the needed dependencies, but today i restarted my laptop and it didn't work, now it throws me this error on the console :

    python2.7 script.py 
    

    returns :

    import numpy as np # get it at: http://numpy.scipy.org/
    from . import random
    from .mtrand import *
    ImportError: /home/francisco/.local/lib/python2.7/site-packages/numpy/random/mtrand.so: undefined symbol: PyFPE_jbuf
    

    seems to me that there is a missing variable in such file, my guess is that the script is looking for the numpy library in the wrong place, since i made so many failed installations maybe i broke something and it only worked out because it was loaded in the temporal memory of the computer.

    I tried installing Anaconda, and i created a new environment and installed the packaged with the anaconda package manager, and even thought i listed all packaged and it returns :

    # packages in environment at /home/francisco/anaconda2/envs/Music:
    #
    biopython                 1.66                np110py27_0  
    cython                    0.23.4                    <pip>
    hdf5                      1.8.15.1                      2  
    mkl                       11.3.1                        0  
    numexpr                   2.5                 np110py27_0  
    numpy                     1.10.4                   py27_1  
    openssl                   1.0.2g                        0  
    pillow                    3.1.1                     <pip>
    pip                       8.1.1                    py27_0  
    pytables                  3.2.2               np110py27_1  
    python                    2.7.11                        0  
    python-ldap               2.4.25                    <pip>
    readline                  6.2                           2  
    reportlab                 3.3.0                     <pip>
    requirements              0.1                       <pip>
    setuptools                20.3                     py27_0  
    sqlite                    3.9.2                         0  
    tables                    3.2.2                     <pip>
    tk                        8.5.18                        0  
    wheel                     0.29.0                   py27_0  
    zlib                      1.2.8                         0  
    

    i still get the same error. I really need help and don't know what else to try. Thanks.

  • Gabriel
    Gabriel over 7 years
    This fixed the issue for me. Thank you!
  • William Ross
    William Ross over 7 years
    Yea, this also fixed the issue for me.
  • Maruf
    Maruf about 6 years
    This fixes the issue.
  • csl
    csl over 5 years
    This actually worked with a CPython compiled from source as well (Python 3.5). Thanks!
  • Jonathan
    Jonathan about 5 years
    I had to do pip uninstall lxml because I had python-lxml package AND the pip version
  • JRajan
    JRajan over 4 years
    Ghost in the machine.
  • iTayb
    iTayb over 4 years
    This was very helpful. Thanks.
  • DMTishler
    DMTishler about 4 years
    I had to uninstall the problematic library and numpy. Then I had to reinstall with pip flag --no-cache-dir. See: stackoverflow.com/a/49199601/927972