pandas: BUG: Pandas Import is failing under Conda Python 3.7

  • [x ] I have checked that this issue has not already been reported.

  • [ x] I have confirmed this bug exists on the latest version of pandas.

  • [ x] (optional) I have confirmed this bug exists on the master branch of pandas.


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Code Sample, a copy-pastable example

import pandas

Problem description

Pandas import is failing.

Expected Output

Pandas to work.

Output of pd.show_versions()

``` Traceback (most recent call last): File "/me/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/__init__.py", line 29, in <module> File "/me/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/_libs/__init__.py", line 13, in <module> ImportError: /me/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/_libs/interval.cpython-37m-x86_64-linux-gnu.so: invalid ELF header

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “/me/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/init.py”, line 37, in <module> ImportError: C extension: /me/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/_libs/interval.cpython-37m-x86_64-linux-gnu.so: invalid ELF header not built. If you want to import pandas from the source directory, you may need to run ‘python setup.py build_ext --force’ to build the C extensions first.Traceback (most recent call last): File “/me/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/init.py”, line 29, in <module> File “/me/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/_libs/init.py”, line 13, in <module> ImportError: /me/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/_libs/interval.cpython-37m-x86_64-linux-gnu.so: invalid ELF header

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “/me/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/init.py”, line 37, in <module> ImportError: C extension: /me/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/_libs/interval.cpython-37m-x86_64-linux-gnu.so: invalid ELF header not built. If you want to import pandas from the source directory, you may need to run ‘python setup.py build_ext --force’ to build the C extensions first.

</details>

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

cc @simonjayhawkins - installation from defaults channel seems to be broken with python 3.7.9. Is there some action we can take here?

Also, should our docs be specifying to install from conda-forge? Note that environment.yml uses conda-forge.