Skip to content

"ModuleNotFoundError: No module named 'numpy' " error when pip installing #181

@sschmidt23

Description

@sschmidt23

We have a recent issue that started occurring: we have a repo where somoclu is installed via pip in a nightly GitHub action. While previously installing just fine, in late October (October 25th to be exact) the action started failing with a "ModuleNotFoundError: No module named 'numpy' " error.

We're not sure if there was an update to setuptools, pypi build code, or something else, but we think it might be due to pypi's handling of build isolation and the lack of explicit build requirements in somoclu, i.e.: this post

(though I do note that this may not be the actual problem since I don't see an actual change from pypi or setuptools in October that would have suddenly triggered this. The errors coming explicitly from setuptools/build_meta does seem relevant in tracking this down).

Here is the full traceback of the error from our GitHub action:

Collecting somoclu (from pz-rail-som->pz-rail==0.1.dev1+ga251e75eb)
  Downloading somoclu-1.7.6.tar.gz (1.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 54.5 MB/s  0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status '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 "/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
        File "/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
        File "/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-a649r7b2/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "/tmp/pip-build-env-a649r7b2/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-a649r7b2/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 512, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-a649r7b2/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 317, in run_setup
          exec(code, locals())
        File "<string>", line 4, in <module>
      ModuleNotFoundError: No module named 'numpy'
      [end of output] 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions