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

Numpy incompatibility error, locally installed repo, Python 3.13 #1688

Open
LinasKo opened this issue Nov 25, 2024 · 4 comments
Open

Numpy incompatibility error, locally installed repo, Python 3.13 #1688

LinasKo opened this issue Nov 25, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@LinasKo
Copy link
Collaborator

LinasKo commented Nov 25, 2024

Reproduction steps:

git clone [email protected]:roboflow/supervision.git supervision-fresh
cd supervision-fresh
poetry install --with dev
poetry shell
echo "import supervision" > simple_script.py
python simple_script.py

This produces:

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.3 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "/Users/linasko/.settler_workspace/pr/supervision-fresh/simple_script.py", line 1, in <module>
    import supervision
  File "/Users/linasko/.settler_workspace/pr/supervision-fresh/supervision/__init__.py", line 9, in <module>
    from supervision.annotators.core import (
  File "/Users/linasko/.settler_workspace/pr/supervision-fresh/supervision/annotators/core.py", line 5, in <module>
    import cv2
  File "/Users/linasko/.settler_workspace/pr/supervision-fresh/.venv/lib/python3.13/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/Users/linasko/.settler_workspace/pr/supervision-fresh/.venv/lib/python3.13/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/opt/homebrew/Cellar/[email protected]/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
AttributeError: _ARRAY_API not found
Traceback (most recent call last):
  File "/Users/linasko/.settler_workspace/pr/supervision-fresh/simple_script.py", line 1, in <module>
    import supervision
  File "/Users/linasko/.settler_workspace/pr/supervision-fresh/supervision/__init__.py", line 9, in <module>
    from supervision.annotators.core import (
    ...<23 lines>...
    )
  File "/Users/linasko/.settler_workspace/pr/supervision-fresh/supervision/annotators/core.py", line 5, in <module>
    import cv2
  File "/Users/linasko/.settler_workspace/pr/supervision-fresh/.venv/lib/python3.13/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
    ~~~~~~~~~^^
  File "/Users/linasko/.settler_workspace/pr/supervision-fresh/.venv/lib/python3.13/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/opt/homebrew/Cellar/[email protected]/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: numpy.core.multiarray failed to import

Environment:

Note:

  • I use locally created .venv environments
  • I use 3.13 as the base, on MacOS.
Poetry env
Found existing alias for "poetry env info". You should use: "pvinf"

Virtualenv
Python:         3.13.0
Implementation: CPython
Path:           /Users/linasko/.settler_workspace/pr/supervision-fresh/.venv
Executable:     /Users/linasko/.settler_workspace/pr/supervision-fresh/.venv/bin/python
Valid:          True

Base
Platform:   darwin
OS:         posix
Python:     3.13.0
Path:       /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.13
Executable: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.13/bin/python3.13
Poetry config

cache-dir = "/Users/linasko/Library/Caches/pypoetry"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
solver.lazy-wheel = true
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/linasko/Library/Caches/pypoetry/virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true

@LinasKo LinasKo added the bug Something isn't working label Nov 25, 2024
@LinasKo
Copy link
Collaborator Author

LinasKo commented Nov 25, 2024

Hey @onuralpszr 👋

Could you check if it also happens on Linux?

@onuralpszr
Copy link
Collaborator

onuralpszr commented Nov 25, 2024

Hey @onuralpszr 👋

Could you check if it also happens on Linux?

Testing with py3.13 linux 👍 - PASSED (no error)

@LinasKo
Copy link
Collaborator Author

LinasKo commented Nov 25, 2024

Thanks a lot!

Confirming this also happens with --depth 1 -b develop.

`pip freeze`
anyio==4.5.2
appnope==0.1.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-lru==2.0.4
attrs==24.2.0
babel==2.16.0
backcall==0.2.0
beautifulsoup4==4.12.3
bleach==6.1.0
build==1.2.2.post1
cachetools==5.5.0
cairocffi==1.7.1
CairoSVG==2.7.1
certifi==2024.8.30
cffi==1.17.1
cfgv==3.4.0
chardet==5.2.0
charset-normalizer==3.4.0
click==8.1.7
colorama==0.4.6
comm==0.2.2
contourpy==1.3.1
cssselect2==0.7.0
cycler==0.12.1
debugpy==1.8.8
decorator==5.1.1
defusedxml==0.7.1
distlib==0.3.9
docutils==0.21.2
executing==2.1.0
fastjsonschema==2.20.0
filelock==3.16.1
fonttools==4.55.0
fqdn==1.5.1
ghp-import==2.1.0
gitdb==4.0.11
GitPython==3.1.43
griffe==1.4.0
h11==0.14.0
httpcore==1.0.7
httpx==0.27.2
identify==2.6.1
idna==3.10
importlib_metadata==8.5.0
importlib_resources==6.4.5
iniconfig==2.0.0
ipykernel==6.29.5
ipython==8.12.3
ipywidgets==8.1.5
isoduration==20.11.0
jaraco.classes==3.4.0
jaraco.context==6.0.1
jaraco.functools==4.1.0
jedi==0.19.2
Jinja2==3.1.4
json5==0.9.28
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-specifications==2023.12.1
jupyter-events==0.10.0
jupyter-lsp==2.2.5
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyter_server==2.14.2
jupyter_server_terminals==0.5.3
jupyterlab==4.2.6
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.3
jupyterlab_widgets==3.0.13
jupytext==1.16.4
keyring==25.5.0
kiwisolver==1.4.7
Markdown==3.7
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.7.2
matplotlib-inline==0.1.7
mdit-py-plugins==0.4.2
mdurl==0.1.2
mergedeep==1.3.4
mike==2.1.3
mistune==3.0.2
mkdocs==1.6.1
mkdocs-autorefs==1.2.0
mkdocs-get-deps==0.2.0
mkdocs-git-committers-plugin-2==2.4.1
mkdocs-git-revision-date-localized-plugin==1.3.0
mkdocs-jupyter==0.24.8
mkdocs-material==9.5.45
mkdocs-material-extensions==1.3.1
mkdocstrings==0.26.1
mkdocstrings-python==1.11.1
more-itertools==10.5.0
mypy==1.13.0
mypy-extensions==1.0.0
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
nh3==0.2.18
nodeenv==1.9.1
notebook==7.2.2
notebook_shim==0.2.4
numpy==2.1.3
opencv-python==4.8.1.78
overrides==7.7.0
packaging==24.2
paginate==0.5.7
pandocfilters==1.5.1
parso==0.8.4
pathspec==0.12.1
pexpect==4.9.0
pickleshare==0.7.5
pillow==10.4.0
pkginfo==1.10.0
platformdirs==4.3.6
pluggy==1.5.0
pre-commit==3.5.0
prometheus_client==0.21.0
prompt_toolkit==3.0.48
psutil==6.1.0
ptyprocess==0.7.0
pure_eval==0.2.3
pycparser==2.22
Pygments==2.18.0
pymdown-extensions==10.12
pyparsing==3.0.9
pyproject-api==1.8.0
pyproject_hooks==1.2.0
pytest==8.3.3
python-dateutil==2.9.0.post0
python-json-logger==2.0.7
pytz==2024.2
PyYAML==6.0.2
pyyaml_env_tag==0.1
pyzmq==26.2.0
readme_renderer==43.0
referencing==0.35.1
regex==2024.11.6
requests==2.32.3
requests-toolbelt==1.0.0
rfc3339-validator==0.1.4
rfc3986==2.0.0
rfc3986-validator==0.1.1
rich==13.9.4
rpds-py==0.20.1
ruff==0.8.0
scipy==1.14.1
Send2Trash==1.8.3
setuptools==75.3.0
six==1.16.0
smmap==5.0.1
sniffio==1.3.1
soupsieve==2.6
stack-data==0.6.3
-e git+ssh://[email protected]/roboflow/supervision.git@bbbb37434c4f7dbc113228c634e17459bb01c4f7#egg=supervision
terminado==0.18.1
tinycss2==1.4.0
tornado==6.4.2
tox==4.23.2
tqdm==4.67.1
traitlets==5.14.3
twine==5.1.1
types-python-dateutil==2.9.0.20241003
typing_extensions==4.12.2
uri-template==1.3.0
urllib3==2.2.3
verspec==0.1.0
virtualenv==20.27.1
watchdog==4.0.2
wcwidth==0.2.13
webcolors==24.8.0
webencodings==0.5.1
websocket-client==1.8.0
wheel==0.45.1
widgetsnbextension==4.0.13
zipp==3.20.2

@onuralpszr
Copy link
Collaborator

onuralpszr commented Nov 25, 2024

Here is my list when I run on python 3.13 with poetry --with dev (NO ERROR - PASSED)

anyio==4.5.2
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-lru==2.0.4
attrs==24.2.0
babel==2.16.0
backcall==0.2.0
beautifulsoup4==4.12.3
bleach==6.1.0
build==1.2.2.post1
cachetools==5.5.0
cairocffi==1.7.1
CairoSVG==2.7.1
certifi==2024.8.30
cffi==1.17.1
cfgv==3.4.0
chardet==5.2.0
charset-normalizer==3.4.0
click==8.1.7
colorama==0.4.6
comm==0.2.2
contourpy==1.3.1
cryptography==43.0.3
cssselect2==0.7.0
cycler==0.12.1
debugpy==1.8.8
decorator==5.1.1
defusedxml==0.7.1
distlib==0.3.9
docutils==0.21.2
executing==2.1.0
fastjsonschema==2.20.0
filelock==3.16.1
fonttools==4.55.0
fqdn==1.5.1
ghp-import==2.1.0
gitdb==4.0.11
GitPython==3.1.43
griffe==1.4.0
h11==0.14.0
httpcore==1.0.7
httpx==0.27.2
identify==2.6.1
idna==3.10
importlib_metadata==8.5.0
importlib_resources==6.4.5
iniconfig==2.0.0
ipykernel==6.29.5
ipython==8.12.3
ipywidgets==8.1.5
isoduration==20.11.0
jaraco.classes==3.4.0
jaraco.context==6.0.1
jaraco.functools==4.1.0
jedi==0.19.2
jeepney==0.8.0
Jinja2==3.1.4
json5==0.9.28
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-specifications==2023.12.1
jupyter-events==0.10.0
jupyter-lsp==2.2.5
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyter_server==2.14.2
jupyter_server_terminals==0.5.3
jupyterlab==4.2.6
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.3
jupyterlab_widgets==3.0.13
jupytext==1.16.4
keyring==25.5.0
kiwisolver==1.4.7
Markdown==3.7
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.7.2
matplotlib-inline==0.1.7
mdit-py-plugins==0.4.2
mdurl==0.1.2
mergedeep==1.3.4
mike==2.1.3
mistune==3.0.2
mkdocs==1.6.1
mkdocs-autorefs==1.2.0
mkdocs-get-deps==0.2.0
mkdocs-git-committers-plugin-2==2.4.1
mkdocs-git-revision-date-localized-plugin==1.3.0
mkdocs-jupyter==0.24.8
mkdocs-material==9.5.45
mkdocs-material-extensions==1.3.1
mkdocstrings==0.26.1
mkdocstrings-python==1.11.1
more-itertools==10.5.0
mypy==1.13.0
mypy-extensions==1.0.0
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
nh3==0.2.18
nodeenv==1.9.1
notebook==7.2.2
notebook_shim==0.2.4
numpy==2.1.3
opencv-python==4.8.1.78
overrides==7.7.0
packaging==24.2
paginate==0.5.7
pandocfilters==1.5.1
parso==0.8.4
pathspec==0.12.1
pexpect==4.9.0
pickleshare==0.7.5
pillow==10.4.0
pkginfo==1.10.0
platformdirs==4.3.6
pluggy==1.5.0
pre-commit==3.5.0
prometheus_client==0.21.0
prompt_toolkit==3.0.48
psutil==6.1.0
ptyprocess==0.7.0
pure_eval==0.2.3
pycparser==2.22
Pygments==2.18.0
pymdown-extensions==10.12
pyparsing==3.0.9
pyproject-api==1.8.0
pyproject_hooks==1.2.0
pytest==8.3.3
python-dateutil==2.9.0.post0
python-json-logger==2.0.7
pytz==2024.2
PyYAML==6.0.2
pyyaml_env_tag==0.1
pyzmq==26.2.0
readme_renderer==43.0
referencing==0.35.1
regex==2024.11.6
requests==2.32.3
requests-toolbelt==1.0.0
rfc3339-validator==0.1.4
rfc3986==2.0.0
rfc3986-validator==0.1.1
rich==13.9.4
rpds-py==0.20.1
ruff==0.8.0
scipy==1.14.1
SecretStorage==3.3.3
Send2Trash==1.8.3
setuptools==75.3.0
six==1.16.0
smmap==5.0.1
sniffio==1.3.1
soupsieve==2.6
stack-data==0.6.3
-e git+ssh://[email protected]/roboflow/supervision.git@bbbb37434c4f7dbc113228c634e17459bb01c4f7#egg=supervision
terminado==0.18.1
tinycss2==1.4.0
tornado==6.4.2
tox==4.23.2
tqdm==4.67.1
traitlets==5.14.3
twine==5.1.1
types-python-dateutil==2.9.0.20241003
typing_extensions==4.12.2
uri-template==1.3.0
urllib3==2.2.3
verspec==0.1.0
virtualenv==20.27.1
watchdog==4.0.2
wcwidth==0.2.13
webcolors==24.8.0
webencodings==0.5.1
websocket-client==1.8.0
wheel==0.45.1
widgetsnbextension==4.0.13
zipp==3.20.2

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

2 participants