pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
42.64k stars 17.58k forks source link

BUG:Installation errors on aarch64 #35932

Closed tathastu871 closed 3 years ago

tathastu871 commented 3 years ago

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

Code Sample, a copy-pastable example

# Your code here
pip3 install pandas
or
pip3 install pandas --no-build-isolation --no-binary :all:
or
python setup.py build_ext --inplace --force
or 
LDFLAGS=" -lm -lcompiler_rt" pip3 install pandas --no-build-isolation --no-binary :all: --no-use-pep517

Problem description

https://termbin.com/wzsr [this should explain why the current behaviour is a problem and why the expected output is a better solution]

Expected Output

Output of pd.show_versions()

When installed from source instead of pip it installs pandas but no submodules Output of pd.show_versions() AttributeError: module 'pandas' has no attribute 'show_versions'

[paste the output of ``pd.show_versions()`` here leaving a blank line after the details tag]
bashtage commented 3 years ago

Can you post the relevant issue from the build log?

What is https://termbin.com/wzsr?

tathastu871 commented 3 years ago

Can you post the relevant issue from the build log?

What is https://termbin.com/wzsr?

i have pasted build log on that site

tathastu871 commented 3 years ago

Initially errors related to cython arised even when its installed. After changing commands it solved but somekind of deprecation eŕror arised as shown in build log.

However when installed directly from source pandas seems to installed even with errors and imported properly but no sub modules were installed.

Means if i use pandas.read_html or excel or other it says no such attributes.

I was able to use previous versions of pandas but on latest version such problem arised

I was using pip version 20.2.2 python 3.8 Below is my pip list output all dependencies are installed

----------------------------- ---------
alabaster                     0.7.12
appdirs                       1.4.4
attrs                         20.1.0
autoflake                     1.3.1
Babel                         2.8.0
bandit                        1.6.2
beautifulsoup4                4.9.1
black                         19.10b0
bleach                        3.1.5
blurhash                      1.1.4
boost                         0.1
bumpversion                   0.5.3
certifi                       2020.6.20
cffi                          1.14.2
chardet                       3.0.4
click                         7.1.2
coverage                      5.0.3
coveralls                     1.10.0
cPython                       0.0.6
cryptography                  3.1
cycler                        0.10.0
Cython                        0.29.21
decorator                     4.4.2
distlib                       0.3.1
distro                        1.5.0
doc8                          0.8.0
docopt                        0.6.2
docutils                      0.16
entrypoints                   0.3
filelock                      3.0.12
flake8                        3.7.9
flake8-2020                   1.5.0
flake8-bandit                 2.1.2
flake8-broken-line            0.1.1
flake8-bugbear                20.1.4
flake8-builtins               1.4.2
flake8-comprehensions         3.2.2
flake8-debugger               3.2.1
flake8-fixme                  1.1.1
flake8-isort                  2.8.0
flake8-logging-format         0.6.0
flake8-mutable                1.2.0
flake8-polyfill               1.0.2
flake8-variables-names        0.0.3
gitdb                         4.0.5
GitPython                     3.1.7
html5lib                      1.1
idna                          2.10
imagesize                     1.2.0
install                       1.3.3
isort                         4.3.21
jeepney                       0.4.3
Jinja2                        2.11.2
joblib                        0.16.0
keyring                       21.3.1
kiwisolver                    1.2.0
lxml                          4.5.2
MarkupSafe                    1.1.1
Mastodon.py                   1.5.1
matplotlib                    3.3.1
mccabe                        0.6.1
more-itertools                8.4.0
numpy                         1.19.1
packaging                     20.4
pathspec                      0.8.0
pbr                           5.4.5
pep8-naming                   0.9.1
Pillow                        7.2.0
pip                           20.2.2
pipenv                        2020.8.13
pkginfo                       1.5.0.1
pluggy                        0.13.1
py                            1.9.0
pycodestyle                   2.5.0
pycparser                     2.20
pydocstyle                    5.0.2
pyflakes                      2.1.1
Pygments                      2.6.1
pymongo                       3.11.0
pyparsing                     2.4.7
pytest                        5.3.5
pytest-cov                    2.8.1
pytest-runner                 5.2
python-dateutil               2.8.1
python-dev-tools              2020.2.5
python-magic                  0.4.18
pytz                          2020.1
pyupgrade                     1.26.2
PyYAML                        5.3.1
readme-renderer               26.0
regex                         2020.7.14
requests                      2.24.0
requests-toolbelt             0.9.1
restructuredtext-lint         1.3.1
scikit-build                  0.11.1
SecretStorage                 3.1.2
scipy                             1.5.1
setuptools                    47.1.0
six                           1.15.0
smmap                         3.0.4
snowballstemmer               2.0.0
soupsieve                     2.0.1
Sphinx                        2.3.1
sphinxcontrib-applehelp       1.0.2
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        1.0.3
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.4
SQLAlchemy                    1.3.19
stevedore                     3.2.0
tabulate                      0.8.7
testfixtures                  6.14.1
tokenize-rt                   4.0.0
toml                          0.10.1
tox                           3.14.3
tqdm                          4.48.2
twine                         3.1.1
typed-ast                     1.4.1
urllib3                       1.25.10
virtualenv                    20.0.31
virtualenv-clone              0.5.4
wcwidth                       0.2.5
webencodings                  0.5.1
wheel                         0.34.2
bashtage commented 3 years ago

Why are you using --no-binary? This appears to be blocking it from building a wheel of pandas.

bashtage commented 3 years ago

What is the log you see from

python setup.py build_ext --inplace --force

tathastu871 commented 3 years ago

Why are you using --no-binary? This appears to be blocking it from building a wheel of pandas. As other options failed. gave it a try. But no success

Without no binary option output log pasted below http://sprunge.us/ssyikp

tathastu871 commented 3 years ago

What is the log you see from

python setup.py build_ext --inplace --force

http://sprunge.us/5v0EuG Pasted on above

tathastu871 commented 3 years ago

Temporary solution: Pandas 1.0.5 seems to be working. However workaround and patching needed for latest 1.1.1 version.

However after installing pandas 1.0.5 pandas.test() gave below error

../usr/lib/python3.8/site-packages/pandas/conftest.py:14: in <module>
    import pandas.util._test_decorators as td
../usr/lib/python3.8/site-packages/pandas/util/_test_decorators.py:176: in <module>
    _skip_if_no_mpl(), reason="Missing matplotlib dependency"
../usr/lib/python3.8/site-packages/pandas/util/_test_decorators.py:97: in _skip_if_no_mpl
    mod.use("Agg", warn=True)
E   TypeError: use() got an unexpected keyword argument 'warn'

However matplotlib is installed

Below is pytest output

============================= test session starts ==============================
platform linux -- Python 3.8.5, pytest-5.3.5, py-1.9.0, pluggy-0.13.1
rootdir: /data/data/com.termux/files/home
plugins: cov-2.8.1, hypothesis-5.29.3
collected 0 items / 1 error

==================================== ERRORS ====================================
________________________ ERROR collecting test session _________________________
../usr/lib/python3.8/site-packages/_pytest/config/__init__.py:459: in _importconftest
    return self._conftestpath2mod[key]
E   KeyError: PosixPath('/data/data/com.termux/files/home/pandas/pandas/conftest.py')

During handling of the above exception, another exception occurred:
pandas/pandas/__init__.py:29: in <module>
    from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
pandas/pandas/_libs/__init__.py:13: in <module>
    from pandas._libs.interval import Interval
E   ModuleNotFoundError: No module named 'pandas._libs.interval'

The above exception was the direct cause of the following exception:
../usr/lib/python3.8/site-packages/_pytest/config/__init__.py:465: in _importconftest
    mod = conftestpath.pyimport()
../usr/lib/python3.8/site-packages/py/_path/local.py:704: in pyimport
    __import__(modname)
pandas/pandas/__init__.py:33: in <module>
    raise ImportError(
E   ImportError: C extension: No module named 'pandas._libs.interval' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.

During handling of the above exception, another exception occurred:
../usr/lib/python3.8/site-packages/py/_path/common.py:383: in visit
    for x in Visitor(fil, rec, ignore, bf, sort).gen(self):
../usr/lib/python3.8/site-packages/py/_path/common.py:435: in gen
    for p in self.gen(subdir):
../usr/lib/python3.8/site-packages/py/_path/common.py:424: in gen
    dirs = self.optsort([p for p in entries
../usr/lib/python3.8/site-packages/py/_path/common.py:425: in <listcomp>
    if p.check(dir=1) and (rec is None or rec(p))])
../usr/lib/python3.8/site-packages/_pytest/main.py:626: in _recurse
    ihook = self.gethookproxy(dirpath)
../usr/lib/python3.8/site-packages/_pytest/main.py:445: in gethookproxy
    my_conftestmodules = pm._getconftestmodules(fspath)
../usr/lib/python3.8/site-packages/_pytest/config/__init__.py:437: in _getconftestmodules
    mod = self._importconftest(conftestpath)
../usr/lib/python3.8/site-packages/_pytest/config/__init__.py:473: in _importconftest
    raise ConftestImportFailure(conftestpath, sys.exc_info())
E   _pytest.config.ConftestImportFailure: (local('/data/data/com.termux/files/home/pandas/pandas/conftest.py'), (<class 'ImportError'>, ImportError("C extension: No module named 'pandas._libs.interval' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first."), <traceback object at 0x70851b7640>))
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
============================== 1 error in 23.40s ===============================

Please implement necessary changes to make latest pandas work on aarch64

ghost commented 3 years ago

@tathastu871 Try this:

export CFLAGS="-Wno-deprecated-declarations -Wno-unreachable-code"
pip install pandas

- fixes https://github.com/pandas-dev/pandas/issues/35932#issuecomment-682082619

tathastu871 commented 3 years ago

@tathastu871 Try this:

export CFLAGS="-Wno-deprecated-declarations -Wno-unreachable-code"
pip install pandas

Thanks man it worked.