Python Forum

Full Version: Illegal instruction (core dumped) when import pandas.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!
I have Python 3.10.6 installed in my system (Lubuntu 22.04). I installed pandas and pyarrow with "pip3 install" command but when I try to import pandas in a .py file or even in the python3 console, like "import pandas as pd" or "import pandas" I get "Illegal instruction (core dumped)".

I tried to resintall pandas with pip and pip3 but I've got the same result:
amanda@amanda-rv415:~$ pip3 install pandas
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pandas in ./.local/lib/python3.10/site-packages (1.5.2)
Requirement already satisfied: numpy>=1.21.0 in ./.local/lib/python3.10/site-packages (from pandas) (1.24.1)
Requirement already satisfied: pytz>=2020.1 in ./.local/lib/python3.10/site-packages (from pandas) (2022.7)
Requirement already satisfied: python-dateutil>=2.8.1 in ./.local/lib/python3.10/site-packages (from pandas) (2.8.2)
Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.8.1->pandas) (1.16.0)
And python3:
amanda@amanda-rv415:~$ sudo apt-get install python3
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3 is already the newest version (3.10.6-1~22.04).
The following packages were automatically installed and are no longer required:
  libflashrom1 libftdi1-2
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
But nothing has changed. I would like to know how can I fix this problem. Thank you!
Quote:I installed pandas and pyarrow with "pip3 install" command

It looks like it was already installed:

Quote:Requirement already satisfied: pandas in ./.local/lib/python3.10/site-packages (1.5.2)

Is it possible that someone copied pandas from another machine, or from another version of Python, into the site-packages directory first?

I would try:

  1. remove the existing version of pandas completely;
  2. reinstall a fresh copy;
  3. make sure that pip does not say the requirement is already satisfied;
  4. if it still fails, that might be a bug in pandas.

In which case, maybe you can get it to work by downgrading to the previous version.