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

Installation of BaSiCPy fails in environment with recent version of setuptools #100

Closed
SilverViking opened this issue Aug 16, 2022 · 5 comments

Comments

@SilverViking
Copy link

In a virtual environment with setuptools >= 61.0.0 installation of BaSiCPy fails with an error. It does work with setuptools < 61.0.0 however. The problem was encountered on Windows, but should also occur on other platforms.

On Windows the problem can be reproduced as follows:

conda create -n test python=3.10
conda activate test
git clone https://github.com/peng-lab/PyBaSiC.git
cd PyBaSiC
pip3 install -e .

This results in the following error:

Obtaining file:///C:/Users/johndoe/PyBaSiC
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      error: Multiple top-level packages discovered in a flat-layout: ['figures', 'pybasic', 'Notebooks', 'ExampleData'].

      To avoid accidental inclusion of unwanted files or directories,
      setuptools will not proceed with this build.

      If you are trying to create a single distribution with multiple packages
      on purpose, you should not rely on automatic discovery.
      Instead, consider the following options:

      1. set up custom discovery (`find` directive with `include` or `exclude`)
      2. use a `src-layout`
      3. explicitly set `py_modules` or `packages` with a list of names

      To find more information, look for "package discovery" on setuptools docs.
      [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.

The error is due to a change first introduced in setuptools 61.0.0. In the environment created above, we automatically got setuptools 61.2.0.

To fix the problem, a (probably small) change to BaSiCPy's setup.py will be needed.

As a temporary workaround, one can install the package anyway by reverting to an older version of setuptools:

pip install setuptools==60.10.0
pip install -e .

BaSiCPy installation then works:

Obtaining file:///C:/Users/johndoe/PyBaSiC
  Preparing metadata (setup.py) ... done
Collecting scipy>=1.3
  Using cached scipy-1.9.0-cp310-cp310-win_amd64.whl (38.6 MB)
...
Installing collected packages: pyparsing, pillow, numpy, networkx, tifffile, scipy, PyWavelets, packaging, imageio, scikit-image, pybasic
  Running setup.py develop for pybasic
Successfully installed PyWavelets-1.3.0 imageio-2.21.1 networkx-2.8.5 numpy-1.23.2 packaging-21.3 pillow-9.2.0 pybasic-0.0.0 pyparsing-3.0.9 scikit-image-0.19.3 scipy-1.9.0 tifffile-2022.8.12
@yfukai
Copy link
Collaborator

yfukai commented Aug 17, 2022

Hi, thanks @SilverViking for your comment! The main branch is now unmaintained, and we are now working on the dev branch. The beta version will appear in PyPi in a couple of days. Please be patient until it becomes available!

@SilverViking
Copy link
Author

Great news @yfukai! Looking forward to trying out the new version. Thanks a lot for your work.

@donovanr
Copy link

donovanr commented Oct 5, 2022

is there a beta release on PyPi or is it recommended to install from source on the dev branch?

@yfukai
Copy link
Collaborator

yfukai commented Dec 1, 2022

Sorry we're a bit late but I expect it will come in a week on PyPi (hopefully!)

@yfukai
Copy link
Collaborator

yfukai commented Dec 5, 2022

We're sorry to be late, but now the beta 1.0.1 version is on PyPi! We welcome any feedback for the beta version.

@yfukai yfukai closed this as completed Dec 5, 2022
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

3 participants