question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Illegal instruction when importing numpy module

See original GitHub issue

When I import numpy, I get Illegal Instruction error

On Debian wheezy, install last numpy version (1.16.1) with pip Then :

root@butters2:~$ python
Python 2.7.3 (default, Nov 19 2017, 01:35:09) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Illegal instruction

It works if I downgrade to version 1.14 maximum

More traces with gdb:
root@butters2:~# gdb -ex r --args python test.py
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python...(no debugging symbols found)...done.
Starting program: /usr/bin/python test.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff3a77700 (LWP 28624)]
[New Thread 0x7ffff3276700 (LWP 28625)]
[New Thread 0x7ffff0a75700 (LWP 28626)]
[New Thread 0x7fffee274700 (LWP 28627)]
[New Thread 0x7fffeba73700 (LWP 28628)]
[New Thread 0x7fffe9272700 (LWP 28629)]
[New Thread 0x7fffe6a71700 (LWP 28630)]
[New Thread 0x7fffe4270700 (LWP 28631)]
[New Thread 0x7fffe1a6f700 (LWP 28632)]
[New Thread 0x7fffdf26e700 (LWP 28633)]
[New Thread 0x7fffdca6d700 (LWP 28634)]
[New Thread 0x7fffda26c700 (LWP 28635)]
[New Thread 0x7fffd7a6b700 (LWP 28636)]
[New Thread 0x7fffd526a700 (LWP 28637)]
[New Thread 0x7fffd2a69700 (LWP 28638)]

Program received signal SIGILL, Illegal instruction.
0x00007ffff5d9f5fa in os_avx_support () at numpy/core/src/umath/cpuid.c:29
29	numpy/core/src/umath/cpuid.c: No such file or directory.
(gdb) 

Where :

root@butters2:~# cat test.py 
#!/usr/bin/env python

import numpy
Debian Packages:
root@butters2:~# dpkg -l | grep python
ii  ipython                                  0.13.1-2+deb7u1                    all          enhanced interactive Python shell
ii  libboost-mpi-python-dev                  1.49.0.1                           amd64        C++ interface to the Message Passing Interface (MPI), Python Bindings (default version)
ii  libboost-mpi-python1.49-dev              1.49.0-3.2                         amd64        C++ interface to the Message Passing Interface (MPI), Python Bindings
ii  libboost-mpi-python1.49.0                1.49.0-3.2                         amd64        C++ interface to the Message Passing Interface (MPI), Python Bindings
ii  libboost-python-dev                      1.49.0.1                           amd64        Boost.Python Library development files (default version)
ii  libboost-python1.49-dev                  1.49.0-3.2                         amd64        Boost.Python Library development files
ii  libboost-python1.49.0                    1.49.0-3.2                         amd64        Boost.Python Library
ii  libpython2.6                             2.6.8-1.1+deb7u1                   amd64        Shared Python runtime library (version 2.6)
ii  libpython2.7                             2.7.3-6+deb7u4                     amd64        Shared Python runtime library (version 2.7)
ii  plasma-scriptengine-python               4:4.8.4-6                          all          Python script engine for Plasma
ii  pylint                                   0.25.1-1                           all          python code static checker and UML diagram generator
ii  python                                   2.7.3-4+deb7u1                     all          interactive high-level object-oriented language (default version)
ii  python-all                               2.7.3-4+deb7u1                     all          package depending on all supported Python runtime versions
ii  python-apt                               0.8.8.2                            amd64        Python interface to libapt-pkg
ii  python-apt-common                        0.8.8.2                            all          Python interface to libapt-pkg (locales)
ii  python-async                             0.6.1-1                            amd64        framework to process interdependent tasks in a pool of workers
ii  python-beautifulsoup                     3.2.1-1                            all          error-tolerant HTML parser for Python
ii  python-brlapi                            4.4-10+deb7u1                      amd64        Python bindings for BrlAPI
ii  python-cairo                             1.8.8-1+b2                         amd64        Python bindings for the Cairo vector graphics library
ii  python-central                           0.6.17                             all          register and build utility for Python packages
ii  python-chardet                           2.0.1-2                            all          universal character encoding detector
ii  python-clientform                        1:0.2.5-3                          all          transitional dummy package
ii  python-configobj                         4.7.2+ds-4                         all          simple but powerful config file reader and writer for Python
ii  python-crypto                            2.6-4+deb7u8                       amd64        cryptographic algorithms and protocols for Python
ii  python-dateutil                          1.5+dfsg-0.1                       all          powerful extensions to the standard datetime module
ii  python-dbus                              1.1.1-1                            amd64        simple interprocess messaging system (Python interface)
ii  python-dbus-dev                          1.1.1-1                            all          main loop integration development files for python-dbus
ii  python-debian                            0.1.21                             all          Python modules to work with Debian-related data formats
ii  python-debianbts                         1.11                               all          Python interface to Debian's Bug Tracking System
ii  python-decorator                         3.3.3-1                            all          simplify usage of Python decorators by programmers
ii  python-dev                               2.7.3-4+deb7u1                     all          header files and a static library for Python (default)
ii  python-docutils                          0.8.1-8                            all          text processing system for reStructuredText (implemented in Python 2)
ii  python-egenix-mxdatetime                 3.2.1-1.1                          amd64        date and time handling routines for Python
ii  python-egenix-mxtools                    3.2.1-1.1                          amd64        collection of additional builtins for Python
ii  python-epydoc                            3.0.1+dfsg-1                       all          tool for documenting Python modules
ii  python-feedparser                        5.1.2-1                            all          Universal Feed Parser for Python
ii  python-foolscap                          0.6.4-1                            all          object-capability-based RPC system for Twisted Python
ii  python-fpconst                           0.7.2-5                            all          Utilities for handling IEEE 754 floating point special values
ii  python-gconf                             2.28.1+dfsg-1                      amd64        Python bindings for the GConf configuration database system
ii  python-gevent                            0.13.6-1+nmu3                      amd64        gevent is a coroutine-based Python networking library
ii  python-gi                                3.2.2-2                            amd64        Python 2.x bindings for gobject-introspection libraries
ii  python-gi-cairo                          3.2.2-2                            amd64        Python Cairo bindings for the GObject library
ii  python-git                               0.3.2~RC1-1                        all          Python library to interact with Git repositories
ii  python-gitdb                             0.5.4-1                            amd64        pure-Python git object database
ii  python-glade2                            2.24.0-3+b1                        amd64        GTK+ bindings: Glade support
ii  python-gnome2                            2.28.1+dfsg-1                      amd64        Python bindings for the GNOME desktop environment
ii  python-gnupginterface                    0.3.2-9.1                          all          Python interface to GnuPG (GPG)
ii  python-gnuplot                           1.8-1.1                            all          A Python interface to the gnuplot plotting program
ii  python-gobject                           3.2.2-2                            all          Python 2.x bindings for GObject - transitional package
ii  python-gobject-2                         2.28.6-10                          amd64        deprecated static Python bindings for the GObject library
ii  python-greenlet                          0.3.1-2.5                          amd64        Lightweight in-process concurrent programming
ii  python-gtk2                              2.24.0-3+b1                        amd64        Python bindings for the GTK+ widget set
ii  python-gtksourceview2                    2.10.1-2                           amd64        Python bindings for the GtkSourceView widget
ii  python-httplib2                          0.7.4-2+deb7u1                     all          comprehensive HTTP client library written for Python
ii  python-imaging                           1.1.7-4+deb7u3                     amd64        Python Imaging Library
ii  python-imaging-tk                        1.1.7-4+deb7u3                     amd64        Python Imaging Library - ImageTk Module
ii  python-jinja2                            2.6-1                              amd64        small but fast and easy to use stand-alone template engine
ii  python-kde4                              4:4.8.4-1                          amd64        Python bindings for the KDE Development Platform
ii  python-keybinder                         0.2.2-4                            amd64        registers global key bindings for applications - Python bindings
ii  python-ldap                              2.4.10-1                           amd64        LDAP interface module for Python
ii  python-liblarch                          0.1.0-1                            all          easily handle data structures
ii  python-liblarch-gtk                      0.1.0-1                            all          easily handle data structures - Treeview support
ii  python-libxml2                           2.8.0+dfsg1-7+wheezy12             amd64        Python bindings for the GNOME XML library
ii  python-logilab-astng                     0.23.1-1                           all          rebuild a new abstract syntax tree (AST) from Python's ast
ii  python-logilab-common                    0.58.0-1                           all          useful miscellaneous modules used by Logilab projects
ii  python-louis                             2.4.1-1                            amd64        Python bindings for liblouis
ii  python-lxml                              2.3.2-1+deb7u1                     amd64        pythonic binding for the libxml2 and libxslt libraries
ii  python-mako                              0.7.0-1.1                          all          fast and lightweight templating for the Python platform
ii  python-markdown                          2.1.1-3                            all          text-to-HTML conversion library/tool (implemented in Python 2)
ii  python-markupsafe                        0.15-1                             amd64        XML/HTML/XHTML Markup safe string for Python
ii  python-matplotlib                        1.1.1~rc2-1                        amd64        Python based plotting system in a style similar to Matlab
ii  python-matplotlib-data                   1.1.1~rc2-1                        all          Python based plotting system (data package)
ii  python-mechanize                         1:0.2.5-3                          all          stateful programmatic web browsing
ii  python-minimal                           2.7.3-4+deb7u1                     all          minimal subset of the Python language (default version)
ii  python-mysqldb                           1.2.3-2                            amd64        Python interface to MySQL
ii  python-nose                              1.1.2-3                            all          test discovery and running of Python's unittest
ii  python-notify                            0.1.1-3                            amd64        Python bindings for libnotify
ii  python-numpy                             1:1.6.2-1.2                        amd64        Numerical Python adds a fast array facility to the Python language
ii  python-oauthlib                          0.1.2-1                            all          generic, spec-compliant implementation of OAuth for Python
ii  python-openid                            2.2.5-3                            all          OpenID support for servers and consumers
ii  python-openssl                           0.13-2+deb7u1                      amd64        Python 2 wrapper around the OpenSSL library
ii  python-packagekit                        0.7.6-3                            all          PackageKit backend Python bindings
ii  python-pam                               0.4.2-13                           amd64        Python interface to the PAM library
ii  python-pandas                            0.8.0-2                            all          data structures for "relational" or "labeled" data
ii  python-pandas-lib                        0.8.0-2                            amd64        low-level implementations and bindings for pandas
ii  python-pexpect                           2.4-1                              all          Python module for automating interactive applications
ii  python-pip                               1.1-3                              all          alternative Python package installer
ii  python-pkg-resources                     0.6.24-1                           all          Package Discovery and Resource Access using pkg_resources
ii  python-pyasn1                            0.1.3-1                            all          ASN.1 library for Python
ii  python-pyatspi                           2.5.3+dfsg-3                       all          Assistive Technology Service Provider Interface - Python bindings
ii  python-pyatspi2                          2.5.3+dfsg-3                       all          Transitional package for assistive technology Python bindings
ii  python-pycurl                            7.19.0-5                           amd64        Python bindings to libcurl
ii  python-pygments                          1.5+dfsg-1+deb7u1                  all          syntax highlighting package written in Python
ii  python-pygresql                          1:4.0-3                            amd64        PostgreSQL module for Python
ii  python-pyorbit                           2.24.0-6+b1                        amd64        A Python language binding for the ORBit2 CORBA implementation
ii  python-pyparsing                         1.5.6+dfsg1-2                      all          Python parsing module
ii  python-qt4                               4.9.3-4                            amd64        Python bindings for Qt4
ii  python-qt4-dbus                          4.9.3-4                            amd64        D-Bus Support for PyQt4
ii  python-renderpm                          2.5-1.1                            amd64        python low level render interface
ii  python-reportbug                         6.4.4+deb7u2                       all          Python modules for interacting with bug tracking systems
ii  python-reportlab                         2.5-1.1                            all          ReportLab library to create PDF documents using Python
ii  python-reportlab-accel                   2.5-1.1                            amd64        C coded extension accelerator for the ReportLab Toolkit
ii  python-requests                          0.12.1-1+deb7u1                    all          elegant and simple HTTP library for Python, built for human beings
ii  python-roman                             0.8.1-8                            all          module for generating/analyzing Roman numerals for Python 2
ii  python-rope                              0.9.2-1                            all          Python refactoring library
ii  python-scipy                             0.10.1+dfsg2-1                     amd64        scientific tools for Python
ii  python-serial                            2.5-2.1                            all          pyserial - module encapsulating access for the serial port
ii  python-setuptools                        0.6.24-1                           all          Python Distutils Enhancements (setuptools compatibility)
ii  python-simplegeneric                     0.8.1-1                            all          simple generic functions for Python
ii  python-simplejson                        2.5.2-1                            amd64        simple, fast, extensible JSON encoder/decoder for Python
ii  python-sip                               4.13.3-2                           amd64        Python/C++ bindings generator runtime library
ii  python-six                               1.1.0-2                            all          Python 2 and 3 compatibility library (Python 2 interface)
ii  python-smmap                             0.8.2-1                            all          pure python implementation of a sliding window memory map manager
ii  python-soappy                            0.12.0-4                           all          SOAP Support for Python
ii  python-speechd                           0.7.1-6.2                          all          Python interface to Speech Dispatcher
ii  python-sphinx                            1.1.3+dfsg-4                       all          documentation generator for Python projects (implemented in Python 2)
ii  python-spyderlib                         2.1.10-2                           all          python IDE for scientists
ii  python-subversion                        1.6.17dfsg-4+deb7u12               amd64        Python bindings for Subversion
ii  python-support                           1.0.15                             all          automated rebuilding support for Python modules
ii  python-svn                               1.7.5-1.1                          amd64        A(nother) Python interface to Subversion
ii  python-textile                           1:2.1.5-1                          all          Python parser for the Textile markup
ii  python-tk                                2.7.3-1                            amd64        Tkinter - Writing Tk applications with Python
ii  python-twisted                           12.0.0-1                           all          Event-based framework for internet applications (dependency package)
ii  python-twisted-bin                       12.0.0-1                           amd64        Event-based framework for internet applications
ii  python-twisted-conch                     1:12.0.0-1                         all          Twisted SSH Implementation
ii  python-twisted-core                      12.0.0-1                           all          Event-based framework for internet applications
ii  python-twisted-lore                      12.0.0-1                           all          Documentation generator with HTML and LaTeX support
ii  python-twisted-mail                      12.0.0-1                           all          SMTP, IMAP and POP protocol implementation
ii  python-twisted-names                     12.0.0-1                           all          DNS protocol implementation with client and server
ii  python-twisted-news                      12.0.0-1                           all          NNTP protocol implementation with client and server
ii  python-twisted-runner                    12.0.0-1                           amd64        Process management, including an inetd server
ii  python-twisted-web                       12.0.0-1                           all          HTTP protocol implementation together with clients and servers
ii  python-twisted-web2                      8.1.0-3                            all          An HTTP/1.1 Server Framework
ii  python-twisted-words                     12.0.0-1                           all          Chat and Instant Messaging
ii  python-tz                                2012c-1                            all          Python version of the Olson timezone database
ii  python-uno                               1:3.5.4+dfsg2-0+deb7u11            amd64        Python-UNO bridge
ii  python-utidylib                          0.2-8                              all          Python wrapper for TidyLib
ii  python-virtualenv                        1.7.1.2-2                          all          Python virtual environment creator
ii  python-vte                               1:0.28.2-5                         amd64        Python bindings for the VTE widget set
ii  python-wnck                              2.32.0+dfsg-2+b1                   amd64        Python bindings for the WNCK library
ii  python-wxgtk2.8                          2.8.12.1-12                        amd64        wxWidgets Cross-platform C++ GUI toolkit (wxPython binding)
ii  python-wxversion                         2.8.12.1-12                        all          wxWidgets Cross-platform C++ GUI toolkit (wxPython version selector)
ii  python-xapian                            1.2.12-2                           amd64        Xapian search engine interface for Python
ii  python-xdg                               0.19-5                             all          Python library to access freedesktop.org standards
ii  python-xlrd                              0.6.1-2                            all          extract data from MS Excel spreadsheet files
ii  python-zeitgeist                         0.9.0.1-1                          all          event logging framework - Python bindings
ii  python-zope.interface                    3.6.1-3                            amd64        Interfaces for Python
ii  python2.6                                2.6.8-1.1+deb7u1                   amd64        Interactive high-level object-oriented language (version 2.6)
ii  python2.6-dev                            2.6.8-1.1+deb7u1                   amd64        Header files and a static library for Python (v2.6)
ii  python2.6-minimal                        2.6.8-1.1+deb7u1                   amd64        Minimal subset of the Python language (version 2.6)
ii  python2.7                                2.7.3-6+deb7u4                     amd64        Interactive high-level object-oriented language (version 2.7)
ii  python2.7-dev                            2.7.3-6+deb7u4                     amd64        Header files and a static library for Python (v2.7)
ii  python2.7-minimal                        2.7.3-6+deb7u4                     amd64        Minimal subset of the Python language (version 2.7)
ii  spyder                                   2.1.10-2                           all          python IDE for scientists
PIP Packages :
root@butters2:~# pip list
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Package          Version     
---------------- ------------
apt-xapian-index 0.45        
async            0.6.1       
BeautifulSoup    3.2.1       
Brlapi           0.5.7       
chardet          2.0.1       
configobj        4.7.2       
decorator        3.3.3       
distribute       0.6.24dev-r0
docutils         0.8.1       
epydoc           3.0.1       
feedparser       5.1.2       
foolscap         0.6.4       
fpconst          0.7.2       
gevent           0.13.6      
gitdb            0.5.4       
GitPython        0.3.2rc1    
GnuPGInterface   0.3.2       
gnuplot-py       1.8         
greenlet         0.3.1       
httplib2         0.7.4       
ipython          0.13.1      
Jinja2           2.6         
liblarch         0.1.0       
liblarch-gtk     0.1.0       
logilab-astng    0.23.1      
logilab-common   0.58.0      
louis            2.4.1       
lxml             2.3.2       
Mako             0.7.0       
Markdown         2.1.1       
MarkupSafe       0.15        
matplotlib       1.1.1rc2    
mechanize        0.2.5       
mercurial        2.2.2       
MySQL-python     1.2.3       
nose             1.1.2       
numexpr          2.6.9       
numpy            1.14.0      
oauthlib         0.1.2       
PAM              0.4.2       
pandas           0.24.1      
pep8             1.2         
pexpect          2.4         
PIL              1.1.7       
pip              19.0.2      
pyasn1           0.1.3       
pycrypto         2.6         
pycurl           7.19.0      
pyflakes         0.5.0       
Pygments         1.5         
PyGreSQL         4.0         
pylint           0.25.1      
pyOpenSSL        0.13        
pyparsing        1.5.6       
pyserial         2.5         
Pyste            0.9.10      
python-apt       0.8.8.2     
python-dateutil  2.8.0       
python-debian    0.1.21      
python-debianbts 1.11        
python-ldap      2.4.10      
python-openid    2.2.5       
pytz             2018.9      
pyxdg            0.19        
reportbug        6.4.4       
reportlab        2.5         
requests         0.12.1      
rope             0.9.2       
scipy            0.10.1      
setuptools       0.6rc11     
simplegeneric    0.8.1       
simplejson       2.5.2       
six              1.12.0      
smmap            0.8.2       
SOAPpy           0.12.0      
Sphinx           1.1.3       
spyder           2.1.10      
textile          2.1.5       
Twisted          -twversion- 
Twisted-Conch    12.0.0      
Twisted-Core     12.0.0      
Twisted-Lore     12.0.0      
Twisted-Mail     12.0.0      
Twisted-Names    12.0.0      
Twisted-News     12.0.0      
Twisted-Runner   12.0.0      
Twisted-Web      12.0.0      
Twisted-Web2     8.1.0       
Twisted-Words    12.0.0      
uTidylib         0.2         
virtualenv       1.7.1.2     
wheel            0.33.0      
wxPython         2.8.12.1    
wxPython-common  2.8.12.1    
xlrd             0.6.1       
XlsxWriter       0.9.6       
zope.interface   3.6.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mattipcommented, Feb 26, 2019

If you wish to force pip to compile from source, you should be able to use the –no-binary :all: flag

0reactions
xeoslaenorcommented, Dec 28, 2020

Hello @mattip

I left the company since then, so I cannot test anymore. As far as I can remember, we have found a solution to avoid the problem. I think you can close this and if someone else has the same problem, there will be some clues to start from.

Thanks for your help

Read more comments on GitHub >

github_iconTop Results From Across the Web

Illegal instruction (core dumped) on import for numpy 1.19.5 ...
Installing numpy 1.19.5 from the manylinux2014 wheel causes a SIGILL. I have tested that this happens on Python 3.7 and 3.9, but numpy...
Read more >
Illegal instruction(core dumped) error on Jetson Nano
The 'illegal instruction' could be due to an recent change in the getauxval(AT_HWCAP). · remove all numpy ref in the site packages of...
Read more >
Numpy throwing illegal instruction(core dumped) error
Now I am getting illegal instruction(core dumped) error while importing numpy, Please help me resolve this issue. DeepSpeech for Jetson Nano.
Read more >
Illegal instruction? working code for months? - Python Forum
"illegal instruction" means the pi is trying to run code that isn't correct for that machine. This isn't a problem with your python...
Read more >
How to Resolve The Error “Illegal instruction (core dumped ...
How to Resolve The Error “Illegal instruction (core dumped)” when Running “import tensorflow” in a Python Program ... This means that TensorFlow ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found