xtcocoapi icon indicating copy to clipboard operation
xtcocoapi copied to clipboard

ModuleNotFoundError: No module named 'numpy' during `pip install xtcocotools` on Mac

Open paksas opened this issue 1 year ago • 6 comments
trafficstars

Steps to reproduce:

  • create a clear virtual environment
  • pip install xtcocotools

Logs:

> pip install xtcocotools
Collecting xtcocotools
  Using cached xtcocotools-1.14.3.tar.gz (28 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
  ╰─> [17 lines of output]
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Library/Frameworks/Python.framework/Versions/3.10/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 "/Library/Frameworks/Python.framework/Versions/3.10/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 "/private/var/folders/b6/lf8qgkhd6s7dy6zgcxh3lfx00000gn/T/pip-build-env-spewdicv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/b6/lf8qgkhd6s7dy6zgcxh3lfx00000gn/T/pip-build-env-spewdicv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/b6/lf8qgkhd6s7dy6zgcxh3lfx00000gn/T/pip-build-env-spewdicv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/private/var/folders/b6/lf8qgkhd6s7dy6zgcxh3lfx00000gn/T/pip-build-env-spewdicv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 2, in <module>
      ModuleNotFoundError: No module named 'numpy'
      [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.

Platform:

  • MacBook M3 Pro
  • OS Sonoma 14.5
  • Python 3.12.4

paksas avatar Jun 16 '24 11:06 paksas

I get the same error when installing in Docker (base image ubuntu:24.04). I tried installing numpy before xtcocotools but the same ModuleNotFoundError error is raised.

msdkhairi avatar Nov 07 '24 21:11 msdkhairi

Try upgrading your build tools:pip install --upgrade setuptools pip wheel This worked for me.

Jupiter-is-BIG avatar Jan 30 '25 23:01 Jupiter-is-BIG

Try upgrading your build tools:pip install --upgrade setuptools pip wheel This worked for me.

This worked perfectly for me as well, thanks

flaviakim avatar Apr 22 '25 10:04 flaviakim

Try upgrading your build tools:pip install --upgrade setuptools pip wheel This worked for me.

Thank you!

AmmarkoV avatar May 28 '25 22:05 AmmarkoV

I'm trying to install xtcocotools in Python 3.8 and getting the same issue; however, I couldn't solve the issue by upgrading build tools. The versions of my build tools are:

  • setuptools 60.2.0 (needed for openxlab 0.1.2)
  • pip 25.0.1
  • wheel 0.45.1 and my platform is:
  • Macbook M3 Pro
  • macOS Sequoia 15.5
  • Python 3.8.20. Apologies for the outdated versions; I am trying to clone an older repo. Any help is greatly appreciated!

Hi3142 avatar May 30 '25 03:05 Hi3142

would be great to get this into the readme. having the same issue

vyeevani avatar Jun 19 '25 23:06 vyeevani