Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when importing articdb and matplotlib on Linux #2181

Open
StageTired opened this issue Feb 14, 2025 · 0 comments
Open

Issue when importing articdb and matplotlib on Linux #2181

StageTired opened this issue Feb 14, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@StageTired
Copy link

Describe the bug

When I import arcticdb and matplotlib together in my script, some internal exception gets raised. The exception pops up on matplotlib import but it points to arcticdb. If I import matplotlib first, artic second, it works fine.

I am not sure whether it should go here or to matplotlib.

Steps/Code to Reproduce

  1. python3.11 -m venv .venv
  2. source .venv/bin/activate
  3. pip install -U arcticdb matplotlib

Script / commands to run:

import arcticdb
import matplotlib.pyplot as plt

Exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/masloa-ext/repos/sandbox/.venv/lib/python3.11/site-packages/matplotlib/__init__.py", line 264, in <module>
    _check_versions()
  File "/home/masloa-ext/repos/sandbox/.venv/lib/python3.11/site-packages/matplotlib/__init__.py", line 249, in _check_versions
    from . import ft2font  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 676, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 579, in module_from_spec
  File "<frozen importlib._bootstrap>", line 542, in _init_module_attrs
arcticdb_ext.exceptions.InternalException: pybind11::attribute_error(module 'matplotlib.ft2font' has no attribute '__path__')

Expected Results

No error is shown.

OS, Python Version and ArcticDB Version

Python: 3.11.11 (main, Dec 4 2024, 08:55:08) [GCC 13.2.0]
OS: Linux-6.8.0-1020-azure-x86_64-with-glibc2.39
ArcticDB: 5.2.3

Backend storage used

No response

Additional Context

Same thing happens when I try it on Azure DevOps hosted agent, if it's useful:

stages:
  - stage: testmatplotlib
    dependsOn: []
    pool:
      vmImage: ubuntu-latest
    jobs:
      - job: build
        steps:
          - task: UsePythonVersion@0
            inputs:
              versionSpec: "3.11"
            displayName: "Use Python 3.11"

          - script: python -m pip install -U "arcticdb==5.2.3" "matplotlib==3.10.0"
            displayName: "Install dependencies"

          - script: python ci/test_arctic.py
            displayName: "The error"

test_arctic.py:

import arcticdb
import matplotlib.pyplot as plt

print("hello world")
Traceback (most recent call last):
  File "/home/vsts/work/1/s/ci/test_arctic.py", line 2, in <module>
    import matplotlib.pyplot as plt
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/matplotlib/__init__.py", line 264, in <module>
    _check_versions()
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/matplotlib/__init__.py", line 249, in _check_versions
    from . import ft2font  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 676, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 579, in module_from_spec
  File "<frozen importlib._bootstrap>", line 542, in _init_module_attrs
arcticdb_ext.exceptions.InternalException: pybind11::attribute_error(module 'matplotlib.ft2font' has no attribute '__path__')
@StageTired StageTired added the bug Something isn't working label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant