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

[BUG] Source installation from PyPI fails #543

Open
ju-w opened this issue Apr 23, 2023 · 1 comment
Open

[BUG] Source installation from PyPI fails #543

ju-w opened this issue Apr 23, 2023 · 1 comment

Comments

@ju-w
Copy link

ju-w commented Apr 23, 2023

Installation from PyPI fails when using source version - non wheel (e.g. python 3.11). Required .pxy files are not there.

To Reproduce
Steps to reproduce the behavior:
pip install pulse2percept --no-binary

Expected behavior
Installation succeeds.

Log

Collecting pulse2percept
  Using cached pulse2percept-0.8.0.tar.gz (7.3 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.9.0 in /work/scratch/<user>/venvs/venv1/lib/python3.11/site-packages (from pulse2percept) (1.24.2)
Requirement already satisfied: scipy>=1.0 in /work/scratch/<user>/venvs/venv1/lib/python3.11/site-packages (from pulse2percept) (1.10.1)
Building wheels for collected packages: pulse2percept
  Building wheel for pulse2percept (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [52 lines of output]
      /tmp/pip-install-ullodsfb/pulse2percept_107b55b1b95d46a5a29fea0ccfea04b2/setup.py:122: DeprecationWarning:

        `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
        of the deprecation of `distutils` itself. It will be removed for
        Python >= 3.12. For older Python versions it will remain present.
        It is recommended to use `setuptools < 60.0` for those Python versions.
        For more details, see:
          https://numpy.org/devdocs/reference/distutils_status_migration.html


        from numpy.distutils.command.build_ext import build_ext
      non-existing path in 'pulse2percept/models': '_temporal.pyx'
      non-existing path in 'pulse2percept/models': '_beyeler2019.pyx'
      non-existing path in 'pulse2percept/models': '_horsager2009.pyx'
      non-existing path in 'pulse2percept/models': '_nanduri2012.pyx'
      non-existing path in 'pulse2percept/models': '_granley2021.pyx'
      non-existing path in 'pulse2percept/models': '_thompson2003.pyx'
      non-existing path in 'pulse2percept/stimuli': '_base.pyx'
      non-existing path in 'pulse2percept/utils': '_fast_math.pyx'
      non-existing path in 'pulse2percept/utils': '_array.pyx'
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-ullodsfb/pulse2percept_107b55b1b95d46a5a29fea0ccfea04b2/setup.py", line 318, in <module>
          setup_package()
        File "/tmp/pip-install-ullodsfb/pulse2percept_107b55b1b95d46a5a29fea0ccfea04b2/setup.py", line 314, in setup_package
          setup(**metadata)
        File "/work/scratch/<user>/venvs/venv1/lib/python3.11/site-packages/numpy/distutils/core.py", line 135, in setup
          config = configuration()
                   ^^^^^^^^^^^^^^^
        File "/tmp/pip-install-ullodsfb/pulse2percept_107b55b1b95d46a5a29fea0ccfea04b2/setup.py", line 193, in configuration
          config.add_subpackage('pulse2percept')
        File "/work/scratch/<user>/venvs/venv1/lib/python3.11/site-packages/numpy/distutils/misc_util.py", line 1050, in add_subpackage
          config_list = self.get_subpackage(subpackage_name, subpackage_path,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/work/scratch/<user>/venvs/venv1/lib/python3.11/site-packages/numpy/distutils/misc_util.py", line 1016, in get_subpackage
          config = self._get_configuration_from_setup_py(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/work/scratch/<user>/venvs/venv1/lib/python3.11/site-packages/numpy/distutils/misc_util.py", line 958, in _get_configuration_from_setup_py
          config = setup_module.configuration(*args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-install-ullodsfb/pulse2percept_107b55b1b95d46a5a29fea0ccfea04b2/pulse2percept/setup.py", line 39, in configuration
          config.ext_modules = cythonize(config.ext_modules,
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/work/scratch/<user>/venvs/venv1/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 973, in cythonize
          module_list, module_metadata = create_extension_list(
                                         ^^^^^^^^^^^^^^^^^^^^^^
        File "/work/scratch/<user>/venvs/venv1/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 816, in create_extension_list
          for file in nonempty(sorted(extended_iglob(filepattern)), "'%s' doesn't match any files" % filepattern):
        File "/work/scratch/<user>/venvs/venv1/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 114, in nonempty
          raise ValueError(error_msg)
      ValueError: '_temporal.pyx' doesn't match any files
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pulse2percept
  Running setup.py clean for pulse2percept
Failed to build pulse2percept
ERROR: Could not build wheels for pulse2percept, which is required to install pyproject.toml-based projects

System specifications (please complete the following information):

  • OS: Linux
  • Python version: 3.11
  • pulse2percept version: 0.8

Additional context
The problem is that the required .pyx files are not distributed with the PyPI package.

@jgranley
Copy link
Member

jgranley commented Jun 6, 2023

Hello!
Thanks for bringing this up. I looked into it and it does appear that some of the cython files are bundled incorrectly for the PyPI package, but this only affects python 3.11, which we currently do not support. If you do need 3.11, a quick and easy work around is to just install from the git source, e.g.: pip install git+https://github.com/pulse2percept/pulse2percept.

If you need to install from the PyPI source for python 3.10 or below, using --use-pep517 (see this pip issue) instead of --no-binary should work.

For python 3.11, all current PyPI installations fail due to cython not finding the required .pyx files. When we officially add support for python 3.11, we'll have to look into fixing this (possibly by adding a pyproject.toml).

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

No branches or pull requests

3 participants