Skip to content

When installing napari, an error originates from a subprocess error: metadata-generation-failed #78

Closed

Description

@yedeer12

Encountered error while generating package metadata.

Activity

  1. LucaMarconato commented on May 19, 2023

    @LucaMarconato
    Member

    Hi @yedeer12, I have never encountered this issue. To help me understand better I kindly ask you to share the following information:

    • operating system
    • environment used (pip/conda/etc)
    • python version
    • commands to reproduce the installation and the error

    Thank you 😊

  2. LucaMarconato commented on May 20, 2023

    @LucaMarconato
    Member

    I could reproduce with mamba, Apple Silicon Mac, Python 3.11.

    I did the following:

    mamba create -n ome python==3.11
    conda activate ome
    # spatialdata-io
    pip install -e .
    # spatialdata-plot
    pip install -e .
    # napari-spatialdata
    pip install -e .
    

    the last command give the error:

    0) (4.65.0)
    Collecting vispy<0.12,>=0.11.0
      Using cached vispy-0.11.0.tar.gz (2.4 MB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... done
    Requirement already satisfied: wrapt>=1.11.1 in /Users/macbook/miniconda3/envs/ome/lib/python3.11/site-packages (from napari[all]->napari-spatialdata==0.1.0) (1.15.0)
    Collecting PyQt5!=5.15.0,>=5.12.3
      Downloading PyQt5-5.15.9.tar.gz (3.2 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 19.9 MB/s eta 0:00:00
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... error
      error: subprocess-exited-with-error
      
      × Preparing metadata (pyproject.toml) did not run successfully.
      │ exit code: 1
      ╰─> [20 lines of output]
          Querying qmake about your Qt installation...
          Traceback (most recent call last):
            File "/Users/macbook/miniconda3/envs/ome/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
              main()
            File "/Users/macbook/miniconda3/envs/ome/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 "/Users/macbook/miniconda3/envs/ome/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
              whl_basename = backend.build_wheel(metadata_directory, config_settings)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/private/tmp/pip-build-env-wx_q2j85/overlay/lib/python3.11/site-packages/sipbuild/api.py", line 46, in build_wheel
              project = AbstractProject.bootstrap('wheel',
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/private/tmp/pip-build-env-wx_q2j85/overlay/lib/python3.11/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
              project.setup(pyproject, tool, tool_description)
            File "/private/tmp/pip-build-env-wx_q2j85/overlay/lib/python3.11/site-packages/sipbuild/project.py", line 602, in setup
              self.update(tool)
            File "/private/tmp/pip-install-jcxal8c7/pyqt5_32d3bc3caad54e24a9c755b581b79574/project.py", line 165, in update
              raise UserException(
          sipbuild.exceptions.UserException
          [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.
    
  3. LucaMarconato commented on May 20, 2023

    @LucaMarconato
    Member
    • answer being edited *

    In my case a workaround was to install from source and change a bit the dependencies. Here are the steps:

    • clone the repo
    • in setup.cfg, replace napari[all] with napari
    • pip install -e .
    • pip install PyQt6 (or even PyQt5 if you are not with an Apple Silicon chip (so not with the arm64 architecture, which is not supported by PyQt5)

    This may work already. In my case the installation didn't give me errors, but I was getting runtime errors due to Apple Silicon packages incompatibility with numcodecs and vispy. A workaround was simply

    pip uninstall numcodecs -y
    mamba install numcodecs -y
    pip uninstall vispy -y
    mamba install vispy -y
    

    The incompatibility with numcodecs may be due to a dependency of multiscale_spatial_image (see here spatial-image/multiscale-spatial-image#77).

    @yedeer12 if you try please let me know if it works for you.

  4. LucaMarconato commented on May 22, 2023

    @LucaMarconato
    Member

    @berombau also pointed out that is better to remove [all] cc @giovp

  5. yedeer12 commented on Jun 5, 2023

    @yedeer12
    Author
  6. yedeer12 commented on Jun 5, 2023

    @yedeer12
    Author
    • answer being edited *

    In my case a workaround was to install from source and change a bit the dependencies. Here are the steps:

    • clone the repo
    • in setup.cfg, replace napari[all] with napari
    • pip install -e .
    • pip install PyQt6 (or even PyQt5 if you are not with an Apple Silicon chip (so not with the arm64 architecture, which is not supported by PyQt5)

    This may work already. In my case the installation didn't give me errors, but I was getting runtime errors due to Apple Silicon packages incompatibility with numcodecs and vispy. A workaround was simply

    pip uninstall numcodecs -y
    mamba install numcodecs -y
    pip uninstall vispy -y
    mamba install vispy -y
    

    The incompatibility with numcodecs may be due to a dependency of multiscale_spatial_image (see here spatial-image/multiscale-spatial-image#77).

    @yedeer12 if you try please let me know if it works for you.

    It works

  7. yedeer12 commented on Jun 5, 2023

    @yedeer12
    Author
    • answer being edited *

    In my case a workaround was to install from source and change a bit the dependencies. Here are the steps:

    • clone the repo
    • in setup.cfg, replace napari[all] with napari
    • pip install -e .
    • pip install PyQt6 (or even PyQt5 if you are not with an Apple Silicon chip (so not with the arm64 architecture, which is not supported by PyQt5)

    This may work already. In my case the installation didn't give me errors, but I was getting runtime errors due to Apple Silicon packages incompatibility with numcodecs and vispy. A workaround was simply

    pip uninstall numcodecs -y
    mamba install numcodecs -y
    pip uninstall vispy -y
    mamba install vispy -y
    

    The incompatibility with numcodecs may be due to a dependency of multiscale_spatial_image (see here spatial-image/multiscale-spatial-image#77).

    @yedeer12 if you try please let me know if it works for you.

    This works! But I have another problem after launched napari.

  8. yedeer12 commented on Jun 5, 2023

    @yedeer12
    Author

    image
    When I try to save the shape by shift+E, there is no response and my console in napari looks empty.
    image
    I wonder how to save the shape.

  9. giovp commented on Jun 5, 2023

    @giovp
    Member

    hi @yedeer12 , the save shape functionality is currently being reworked by @melonora , will keep you posted once it's ready but should be soon!

  10. yedeer12 commented on Jun 5, 2023

    @yedeer12
    Author

    hi @yedeer12 , the save shape functionality is currently being reworked by @melonora , will keep you posted once it's ready but should be soon!

    Thanks!

  11. melonora commented on Oct 16, 2023

    @melonora
    Collaborator

    Bit late but draft PR is open #168, it has some dependencies on work in SpatialData itself though, but will be available soon.

  12. LucaMarconato commented on Oct 16, 2023

    @LucaMarconato
    Member

    (closed because the installation has been fixed by #111)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions