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

Source install fails due exceptions in setup.py #14

Open
hiir opened this issue Oct 25, 2018 · 0 comments
Open

Source install fails due exceptions in setup.py #14

hiir opened this issue Oct 25, 2018 · 0 comments

Comments

@hiir
Copy link

hiir commented Oct 25, 2018

Hello,

I stumbled over following issue.

When installing a package with spherecluster dependency and spherecluster is installed from source distribution (.tgz) then it fails with exception numpy is required during installation raised from setup.py#12 even when package has correctly numpy (and scipy) dependencies listed.

How to reproduce:

  1. make a toy setup.py

from setuptools import setup

setup(
    name="spherecluster_test",
    version="1.0.0",
    install_requires=["numpy", "scipy", "spherecluster"]
)
  1. build it to wheel
python setup.py bdist_wheel
  1. try to install it with --no-binary option to force spherecluser source distribution:
pip install --no-binary "spherecluster" dist/spherecluster_test-1.0.0-py3-none-any.whl

Processing ./dist/spherecluster_test-1.0.0-py3-none-any.whl
Collecting scipy (from spherecluster-test==1.0.0)
  Using cached https://files.pythonhosted.org/packages/a8/0b/f163da98d3a01b3e0ef1cab8dd2123c34aee2bafbb1c5bffa354cc8a1730/scipy-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting numpy (from spherecluster-test==1.0.0)
  Using cached https://files.pythonhosted.org/packages/16/21/2e88568c134cc3c8d22af290865e2abbd86efa58a1358ffcb19b6c74f9a3/numpy-1.15.3-cp36-cp36m-manylinux1_x86_64.whl
Collecting spherecluster (from spherecluster-test==1.0.0)
  Using cached https://files.pythonhosted.org/packages/27/27/614b9e568e9a9a8d46938310b7caf092657343bf037b9fae416baf611d06/spherecluster-0.1.6.tar.gz
    Complete output from command python setup.py egg_info:
    numpy is required during installation

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-gtqjhbjz/spherecluster/

I suggest to remove following lines from setup.py#L9-L19.

try:
    import numpy  # NOQA
except ImportError:
    print('numpy is required during installation')
    sys.exit(1)

try:
    import scipy  # NOQA
except ImportError:
    print('scipy is required during installation')
    sys.exit(1)
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

1 participant