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

metadata-generation-failed when trying to follow basic instructions #126

Open
AaronWatters opened this issue Mar 6, 2023 · 1 comment · May be fixed by #127 or #128
Open

metadata-generation-failed when trying to follow basic instructions #126

AaronWatters opened this issue Mar 6, 2023 · 1 comment · May be fixed by #127 or #128

Comments

@AaronWatters
Copy link

Hi folks. I tried to follow the instructions in the README and here
https://ipywidgets.readthedocs.io/en/8.0.2/examples/Widget%20Custom.html
and in both cases I get the following.

$ python -m pip install -e .
Obtaining file:///Users/awatters/ipyemail
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Installing backend dependencies ... done
  Preparing editable metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [60 lines of output]
      INFO:hatch_jupyter_builder.utils:Running jupyter-builder
      INFO:hatch_jupyter_builder.utils:Building with hatch_jupyter_builder.npm_builder
      INFO:hatch_jupyter_builder.utils:With kwargs: {'path': '.', 'build_cmd': 'build:prod'}
      INFO:hatch_jupyter_builder.utils:Installing build dependencies with npm.  This may take a while...
      INFO:hatch_jupyter_builder.utils:> /opt/anaconda3/envs/ipyemail/bin/npm install
      npm ERR! code ERESOLVE
      npm ERR! ERESOLVE unable to resolve dependency tree
      npm ERR!
      npm ERR! While resolving: [email protected]
      npm ERR! Found: jest@undefined
      npm ERR! node_modules/jest
      npm ERR!   dev jest@"^26.0.0" from the root project
      npm ERR!
      npm ERR! Could not resolve dependency:
      npm ERR! peer jest@">=26 <27" from [email protected]
      npm ERR! node_modules/ts-jest
      npm ERR!   dev ts-jest@"^26.0.0" from the root project
      npm ERR!
      npm ERR! Fix the upstream dependency conflict, or retry
      npm ERR! this command with --force, or --legacy-peer-deps
      npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
      npm ERR!
      npm ERR! See /Users/awatters/.npm/eresolve-report.txt for a full report.
      
      npm ERR! A complete log of this run can be found in:
      npm ERR!     /Users/awatters/.npm/_logs/2023-03-06T17_13_40_323Z-debug-0.log
      Traceback (most recent call last):
        File "/opt/anaconda3/envs/ipyemail/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 167, in prepare_metadata_for_build_editable
          hook = backend.prepare_metadata_for_build_editable
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'hatchling.build' has no attribute 'prepare_metadata_for_build_editable'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/opt/anaconda3/envs/ipyemail/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/anaconda3/envs/ipyemail/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 "/opt/anaconda3/envs/ipyemail/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 176, in prepare_metadata_for_build_editable
          whl_basename = build_hook(metadata_directory, config_settings)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/6q/d5mwddn12v7_pkq3_6cc5t8c0000gq/T/pip-build-env-zr78fuae/overlay/lib/python3.11/site-packages/hatchling/build.py", line 78, in build_editable
          return os.path.basename(next(builder.build(wheel_directory, ['editable'])))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/6q/d5mwddn12v7_pkq3_6cc5t8c0000gq/T/pip-build-env-zr78fuae/overlay/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 150, in build
          build_hook.initialize(version, build_data)
        File "/private/var/folders/6q/d5mwddn12v7_pkq3_6cc5t8c0000gq/T/pip-build-env-zr78fuae/normal/lib/python3.11/site-packages/hatch_jupyter_builder/plugin.py", line 83, in initialize
          raise e
        File "/private/var/folders/6q/d5mwddn12v7_pkq3_6cc5t8c0000gq/T/pip-build-env-zr78fuae/normal/lib/python3.11/site-packages/hatch_jupyter_builder/plugin.py", line 78, in initialize
          build_func(self.target_name, version, **build_kwargs)
        File "/private/var/folders/6q/d5mwddn12v7_pkq3_6cc5t8c0000gq/T/pip-build-env-zr78fuae/normal/lib/python3.11/site-packages/hatch_jupyter_builder/utils.py", line 114, in npm_builder
          run(npm_cmd + ["install"], cwd=str(abs_path))
        File "/private/var/folders/6q/d5mwddn12v7_pkq3_6cc5t8c0000gq/T/pip-build-env-zr78fuae/normal/lib/python3.11/site-packages/hatch_jupyter_builder/utils.py", line 227, in run
          return subprocess.check_call(cmd, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/anaconda3/envs/ipyemail/lib/python3.11/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/opt/anaconda3/envs/ipyemail/bin/npm', 'install']' 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: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I checked that I have the latest node and npm recommended for mac and I'm running python 3.11.0 if that matters.

@ianhi ianhi linked a pull request Mar 8, 2023 that will close this issue
@ianhi
Copy link
Contributor

ianhi commented Mar 8, 2023

I think this is the same as #124 and hopefully fixed by #127

@agoose77 agoose77 linked a pull request Mar 12, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants