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

Pre-requirements dependency on Numpy 1.18.5 breaks scipy #14

Open
duytnguyendtn opened this issue Dec 13, 2021 · 2 comments
Open

Pre-requirements dependency on Numpy 1.18.5 breaks scipy #14

duytnguyendtn opened this issue Dec 13, 2021 · 2 comments

Comments

@duytnguyendtn
Copy link
Contributor

In testing #13, I ran into a bug when I tried to import Imviz:

>>> from jdaviz import Imviz
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\jdaviz\__init__.py", line 11, in <module>
    from jdaviz.configs.specviz import Specviz, SpecViz  # noqa
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\jdaviz\configs\__init__.py", line 1, in <module>
    from .cubeviz import *  # noqa
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\jdaviz\configs\cubeviz\__init__.py", line 1, in <module>
    from .plugins import *  # noqa
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\jdaviz\configs\cubeviz\plugins\__init__.py", line 1, in <module>
    from .viewers import *  # noqa
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\jdaviz\configs\cubeviz\plugins\viewers.py", line 2, in <module>
    from glue_jupyter.bqplot.image import BqplotImageView
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\glue_jupyter\bqplot\image\__init__.py", line 1, in <module>
    from .layer_artist import *  # noqa
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\glue_jupyter\bqplot\image\layer_artist.py", line 1, in <module>
    import skimage.measure
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\skimage\measure\__init__.py", line 6, in <module>
    from ._polygon import approximate_polygon, subdivide_polygon
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\skimage\measure\_polygon.py", line 2, in <module>
    from scipy import signal
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\scipy\signal\__init__.py", line 310, in <module>
    from ._peak_finding import *
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\scipy\signal\_peak_finding.py", line 8, in <module>
    from scipy.stats import scoreatpercentile
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\scipy\stats\__init__.py", line 441, in <module>    from .stats import *
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\scipy\stats\stats.py", line 43, in <module>
    from . import distributions
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\scipy\stats\distributions.py", line 11, in <module>
    from . import _discrete_distns
  File "E:\STScI\gitRepos\aas239-jwebbinar\envvalidate\lib\site-packages\scipy\stats\_discrete_distns.py", line 19, in <module>
    from .biasedurn import (_PyFishersNCHypergeometric,
  File "biasedurn.pyx", line 1, in init scipy.stats.biasedurn
ModuleNotFoundError: No module named 'numpy.random.bit_generator'

Pey Lian was able to trace it down to our pre-requirement on numpy:
https://github.com/spacetelescope/aas239-jwebbinar/blob/main/00_Installation/pre-requirements.txt#L2
specifically:
https://numpy.org/doc/stable/release/1.19.0-notes.html#numpy-random-bit-generator-moved-to-numpy-random-bit-generator

This above pinning on numpy==1.18.5 seems incompatible with our scipy requirement:
https://github.com/spacetelescope/aas239-jwebbinar/blob/main/00_Installation/requirements.txt#L1

Even though scipy 1.7.3 claims support for numpy>=1.16.5, this seems to be breaking... This was fixed when Pey Lian suggested I upgrade numpy. Is there a reason why we have numpy pinned to 1.18.5 @mustaric @eteq @orifox?

@pllim
Copy link

pllim commented Dec 13, 2021

If you have Python 3.9 installed via conda, conda won't even let you install such an old version of Numpy. If possible, these dependencies should be moved into a conda environment YAML file: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#building-identical-conda-environments

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - numpy==1.18.5 -> python[version='>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0']

Your python: python=3.9

@pllim
Copy link

pllim commented Dec 13, 2021

I also opened issue upstream here:

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

2 participants