pysptk icon indicating copy to clipboard operation
pysptk copied to clipboard

Installation Error : Error importing numpy

Open AIGamer28100 opened this issue 9 months ago • 0 comments

When Trying to install with pip/poetry I'm getting Import error: Error importing numpy

But when I try to install directly using the source code tar file, It is working without any issues.

Kindly please check and update on this...

Note :

Output is taken when running inside conda env, but the issue also happens outside of the env (user install).

Conda version = 24.9.2 Poetry version = 1.1.15 Python version = 3.10.6 Pip version = 24.3.1 numpy version (pre-installed) = 2.2.1

$ pip install pysptk
Collecting pysptk
  Downloading pysptk-1.0.1.tar.gz (461 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [67 lines of output]
      fatal: not a git repository (or any parent up to mount point /)
      Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
      <string>:58: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      Traceback (most recent call last):
        File "/tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/numpy/_core/__init__.py", line 23, in <module>
          from . import multiarray
        File "/tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/numpy/_core/multiarray.py", line 10, in <module>
          from . import overrides
        File "/tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/numpy/_core/overrides.py", line 7, in <module>
          from numpy._core._multiarray_umath import (
      ImportError: /tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/numpy/_core/_multiarray_umath.cpython-310-x86_64-linux-gnu.so: failed to map segment from shared object
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/numpy/__init__.py", line 114, in <module>
          from numpy.__config__ import show_config
        File "/tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/numpy/__config__.py", line 4, in <module>
          from numpy._core._multiarray_umath import (
        File "/tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/numpy/_core/__init__.py", line 49, 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.10 from "~/miniconda3/envs/env/bin/python"
        * The NumPy version is: "2.2.1"
      
      and make sure that they are the versions you expect.
      Please carefully study the documentation linked above for further help.
      
      Original error was: /tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/numpy/_core/_multiarray_umath.cpython-310-x86_64-linux-gnu.so: failed to map segment from shared object
      
      
      The above exception was the direct cause of the following exception:
      
      Traceback (most recent call last):
        File "~/miniconda3/envs/env/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "~/miniconda3/envs/env/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "~/miniconda3/envs/env/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "/tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 87, in <module>
        File "/tmp/pip-build-env-p0hffrbt/overlay/lib/python3.10/site-packages/numpy/__init__.py", line 119, 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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

AIGamer28100 avatar Jan 16 '25 10:01 AIGamer28100