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

[Bug/Error]: Keeps getting "PyExc_ValueError" error while installing #19213

Closed
RajDave-Dev opened this issue Feb 12, 2024 · 1 comment
Closed
Labels
python Issue is about Python related stuff, including pip question

Comments

@RajDave-Dev
Copy link

Problem description

I am getting "PyExc_ValueError" error when install chromadb, I have virtual env with latest python on official apt.
Stack trace:

Traceback (most recent call last):
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-2t6mkx8t/overlay/lib/python3.11/site-packages/numpy/core/__init__.py", line 24, in <module>
          from . import multiarray
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-2t6mkx8t/overlay/lib/python3.11/site-packages/numpy/core/multiarray.py", line 10, in <module>
          from . import overrides
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-2t6mkx8t/overlay/lib/python3.11/site-packages/numpy/core/overrides.py", line 8, in <module>
          from numpy.core._multiarray_umath import (
      ImportError: dlopen failed: cannot locate symbol "PyExc_ValueError" referenced by "/data/data/com.termux/files/usr/tmp/pip-build-env-2t6mkx8t/overlay/lib/python3.11/site-packages/numpy/core/_multiarray_umath.cpython-311.so"...

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-2t6mkx8t/overlay/lib/python3.11/site-packages/numpy/__init__.py", line 130, in <module>
          from numpy.__config__ import show as show_config
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-2t6mkx8t/overlay/lib/python3.11/site-packages/numpy/__config__.py", line 4, in <module>
          from numpy.core._multiarray_umath import (
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-2t6mkx8t/overlay/lib/python3.11/site-packages/numpy/core/__init__.py", line 50, in <module>
          raise ImportError(msg)
      ImportError:

      IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

      Importing the numpy C-extensions failed. This error can happen for
      many reasons, often due to issues with your setup or how NumPy was
      installed.

      We have compiled some common reasons and troubleshooting tips at:

          https://numpy.org/devdocs/user/troubleshooting-importerror.html

      Please note and check the following:

        * The Python version is: Python3.11 from "/data/data/com.termux/files/home/python/bin/python"
        * The NumPy version is: "1.26.4"

      and make sure that they are the versions you expect.
      Please carefully study the documentation linked above for further help.

      Original error was: dlopen failed: cannot locate symbol "PyExc_ValueError" referenced by "/data/data/com.termux/files/usr/tmp/pip-build-env-2t6mkx8t/overlay/lib/python3.11/site-packages/numpy/core/_multiarray_umath.cpython-311.so"...


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

      Traceback (most recent call last):
        File "/data/data/com.termux/files/home/python/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/data/data/com.termux/files/home/python/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/data/data/com.termux/files/home/python/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-2t6mkx8t/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-2t6mkx8t/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-2t6mkx8t/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 5, in <module>
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-2t6mkx8t/overlay/lib/python3.11/site-packages/numpy/__init__.py", line 135, in <module>
          raise ImportError(msg) from e
      ImportError: Error importing numpy: you should not try to import numpy from
              its source directory; please exit the numpy source tree, and relaunch
              your python interpreter from there.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Numpy is installed but when installing the chromadb this error occurrs! I have tried LDFLAGS=" -lm -lpython3.11" as referenced in #249 of numpy but no luck!

What steps will reproduce the bug?

  1. Use virtual env
  2. Activate venv
  3. Install numpy using pip install
  4. Install chromadb using pip install

I have installed libandroid-spawn cmake build-essentials glang rust golang packages in apt

What is the expected behavior?

Should build without errors.

System information

termux-info:

Termux Variables:
TERMUX_API_APP__VERSION_NAME=0.50.1+4159c62
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP__AM_SOCKET_SERVER_ENABLED=true
TERMUX_APP__APK_PATH=/data/app/~~jlGC9lCBxMwQxXrUS1Dx2Q==/com.termux-mIdQN9u7jGNR8KDutSi3hw==/base.apk
TERMUX_APP__APK_RELEASE=GITHUB
TERMUX_APP__FILES_DIR=/data/user/0/com.termux/files
TERMUX_APP__IS_DEBUGGABLE_BUILD=true
TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false
TERMUX_APP__PACKAGE_MANAGER=apt
TERMUX_APP__PACKAGE_NAME=com.termux
TERMUX_APP__PACKAGE_VARIANT=apt-android-7
TERMUX_APP__PID=23267
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c221,c256,c512,c768
TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete
TERMUX_APP__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c221,c256,c512,c768
TERMUX_APP__TARGET_SDK=28
TERMUX_APP__UID=10221
TERMUX_APP__USER_ID=0
TERMUX_APP__VERSION_CODE=118
TERMUX_APP__VERSION_NAME=0.118.0+10a276a
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0+10a276a
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main/ stable main
Updatable packages:
All packages up to date
termux-tools version:
1.40.6
Android version:
13
Kernel build information:
Linux localhost 4.19.191+ #1 SMP PREEMPT Mon Dec 18 22:51:05 CST 2023 aarch64 Android
Device manufacturer:
TECNO
Device model:
TECNO LH8n
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51
com.termux.x11 versionCode:14
@RajDave-Dev RajDave-Dev added bug report Something is not working properly untriaged labels Feb 12, 2024
@sylirre
Copy link
Member

sylirre commented Feb 12, 2024

#19126

MATHLIB=m LDFLAGS="-lpython3.11" pip3 install --no-build-isolation --no-cache-dir numpy

@sylirre sylirre closed this as completed Feb 12, 2024
@sylirre sylirre added question python Issue is about Python related stuff, including pip and removed bug report Something is not working properly untriaged labels Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Issue is about Python related stuff, including pip question
Projects
None yet
Development

No branches or pull requests

2 participants