This script: > import pandas as pd > print(pd.show_versions()) fails: > Traceback (most recent call last): > File "/disk-samsung/freebsd-ports/misc/py-eemeter/v.py", line 5, in <module> > print(pd.show_versions()) > File "/usr/local/lib/python3.9/site-packages/pandas/util/_print_versions.py", line 109, in show_versions > deps = _get_dependency_info() > File "/usr/local/lib/python3.9/site-packages/pandas/util/_print_versions.py", line 88, in _get_dependency_info > mod = import_optional_dependency(modname, errors="ignore") > File "/usr/local/lib/python3.9/site-packages/pandas/compat/_optional.py", line 115, in import_optional_dependency > module = importlib.import_module(name) > File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module > return _bootstrap._gcd_import(name[level:], package, level) > File "<frozen importlib._bootstrap>", line 1030, in _gcd_import > File "<frozen importlib._bootstrap>", line 1007, in _find_and_load > File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked > File "<frozen importlib._bootstrap>", line 680, in _load_unlocked > File "<frozen importlib._bootstrap_external>", line 850, in exec_module > File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed > File "/usr/local/lib/python3.9/site-packages/setuptools/__init__.py", line 8, in <module> > import _distutils_hack.override # noqa: F401 > File "/usr/local/lib/python3.9/site-packages/_distutils_hack/override.py", line 1, in <module> > __import__('_distutils_hack').do_override() > File "/usr/local/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 77, in do_override > ensure_local_distutils() > File "/usr/local/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 64, in ensure_local_distutils > assert '_distutils' in core.__file__, core.__file__ > AssertionError: /usr/local/lib/python3.9/distutils/core.py Version: 1.3.5,1 Python-3.9 FreeBSD 13.1 STABLE
I cannnot reproduce the error, after I update pandas to 1.4.4. wen
(In reply to Yuri Victorovich from comment #0) - Is/was there any additional lines after 'AssertionError', seems truncated? - Does the latest version (1.4.4) reproduce the issue too ?
I suppose this should be closed as resolved. pandas is now 2.0.3 in ports and show_versions() works fine there: In [1]: import pandas as pd In [2]: print(pd.show_versions()) /usr/local/lib/python3.9/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") INSTALLED VERSIONS ------------------ commit : 0f437949513225922d851e9581723d82120684a6 python : 3.9.18.final.0 python-bits : 64 OS : FreeBSD OS-release : 15.0-CURRENT [skip]
The same script fails because apparently the numba dependency is missing: > $ python3.9 test-pandas.py > /usr/local/lib/python3.9/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils. > warnings.warn("Setuptools is replacing distutils.") > Traceback (most recent call last): > File "/usr/ports/test-pandas.py", line 2, in <module> > print(pd.show_versions()) > File "/usr/local/lib/python3.9/site-packages/pandas/util/_print_versions.py", line 109, in show_versions > deps = _get_dependency_info() > File "/usr/local/lib/python3.9/site-packages/pandas/util/_print_versions.py", line 88, in _get_dependency_info > mod = import_optional_dependency(modname, errors="ignore") > File "/usr/local/lib/python3.9/site-packages/pandas/compat/_optional.py", line 157, in import_optional_dependency > version = get_version(module_to_get) > File "/usr/local/lib/python3.9/site-packages/pandas/compat/_optional.py", line 84, in get_version > raise ImportError(f"Can't determine version for {module.__name__}") > ImportError: Can't determine version for numba
Ok, I was able to reproduce after installing py39-numba. Anyway, it's not listed as a default (or optional) dependency of pandas, so I'd report that upstream instead. Works just fine w/o numba installed.
According to the docs [1], numba 0.56.2 that we have in ports need numpy =< 1.24, while we have version 1.25 in ports. So the problem port is numba, not pandas. Solution would be to upgrade numba to at least 0.57.0, that added support for numpy 1.25. [1] https://github.com/numba/numba/blob/f0be9696dbc7427cd218dcea23363fe01745aea8/docs/source/user/installing.rst#version-support-information
(In reply to Yuri Victorovich from comment #0) that message actually can be triggered by just import numba