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

During clean install run into: ModuleNotFoundError: No module named 'numpy' #342

Closed
jsnguyen opened this issue Sep 5, 2023 · 2 comments
Closed

Comments

@jsnguyen
Copy link

jsnguyen commented Sep 5, 2023

Issue

Using a clean environment on Python 3.11.4, running

pip install orbitize

Produces the following error:

Obtaining file:///home/jsn/landing/programs/orbitize
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... error
  error: subprocess-exited-with-error

  × Getting requirements to build editable did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "/home/jsn/.pyenv/versions/3.11.2/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/jsn/.pyenv/versions/3.11.2/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 "/home/jsn/.pyenv/versions/3.11.2/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 132, in get_requires_for_build_editable
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ip4a3a1v/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 468, in get_requires_for_build_editable
          return self.get_requires_for_build_wheel(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ip4a3a1v/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ip4a3a1v/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-ip4a3a1v/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-ip4a3a1v/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, 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 editable 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

Running pip install numpy does not help the problem. I was able to reproduce this on 2 different machines with and without virtual environments. I'm also using pyenv to manage Python versions, but I have confirmed that pip is installing packages to where they should be.

Solution

The solution I came up with was running:

pip install wheel

Then

pip install orbitize

seems to work.

Adding wheel to the requirements.txt does not fix the problem, you have to run pip install wheel separately.

Might be helpful to include this in the docs since it fails on a clean virtual environment. Not sure if there's a better way to fix this, might also be an issue with newer Python versions.

@sblunt
Copy link
Owner

sblunt commented Sep 19, 2023

Thanks for the bug report @jsnguyen! I'll add this to our docs.

sblunt added a commit that referenced this issue Sep 19, 2023
@sblunt
Copy link
Owner

sblunt commented Sep 19, 2023

Documentation added in 4ee8274

@sblunt sblunt closed this as completed Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants