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

Error "No module named pip" when building with pip install --use-pep517 #179

Closed
ForceBru opened this issue Jan 19, 2023 · 2 comments
Closed

Comments

@ForceBru
Copy link

Cyipopt fails to build when --use-pip517 is passed to pip install cyipopt:

~ $ pip cache purge
Files removed: 6
~ $ /Users/forcebru/mambaforge/bin/python3.10 -m pip install --use-pep517 cyipopt
Collecting cyipopt
  Downloading cyipopt-1.2.0.tar.gz (46 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.4/46.4 kB 336.6 kB/s eta 0:00:00
  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
  ╰─> [43 lines of output]
      /private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      /Users/forcebru/mambaforge/bin/python3.10: No module named pip
      Traceback (most recent call last):
        File "/private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/setuptools/installer.py", line 82, in fetch_build_egg
          subprocess.check_call(cmd)
        File "/Users/forcebru/mambaforge/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/Users/forcebru/mambaforge/bin/python3.10', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/tmpdae3ub3e', '--quiet', 'numpy>=1.15']' returned non-zero exit status 1.
      
      The above exception was the direct cause of the following exception:
      
      Traceback (most recent call last):
        File "/Users/forcebru/mambaforge/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
          main()
        File "/Users/forcebru/mambaforge/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/forcebru/mambaforge/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 484, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 26, in <module>
        File "/private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 874, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/pkg_resources/__init__.py", line 815, in resolve
          dist = self._resolve_dist(
        File "/private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/pkg_resources/__init__.py", line 851, in _resolve_dist
          dist = best[req.key] = env.best_match(
        File "/private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1123, in best_match
          return self.obtain(req, installer)
        File "/private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1135, in obtain
          return installer(requirement)
        File "/private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 944, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "/private/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/pip-build-env-sz40fl69/overlay/lib/python3.10/site-packages/setuptools/installer.py", line 84, in fetch_build_egg
          raise DistutilsError(str(e)) from e
      distutils.errors.DistutilsError: Command '['/Users/forcebru/mambaforge/bin/python3.10', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/var/folders/ys/3h0gnqns4b98zb66_vl_m35m0000gn/T/tmpdae3ub3e', '--quiet', 'numpy>=1.15']' returned non-zero exit status 1.
      [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.
~ [1] $ 

However, /Users/forcebru/mambaforge/bin/python3.10: No module named pip is not true because I'm literally using this exact interpreter to run pip above and it works:

/Users/forcebru/mambaforge/bin/python3.10 -m pip install --use-pep517 cyipopt

This prevents me from installing cyipopt with Poetry: python-poetry/poetry#7368.

Installing without the --use-pep517 option works fine.

@moorepants
Copy link
Collaborator

We do not yet support pep517. See #167. I'm closing this since we already have an open issue. Thanks for the report.

@moorepants
Copy link
Collaborator

One workaround is to install from the git repository instead of pypi. We have a project.toml file in the git repo now.

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