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

Pinned scipy dependency #40884

Closed
mirekphd opened this issue Jun 28, 2020 · 16 comments
Closed

Pinned scipy dependency #40884

mirekphd opened this issue Jun 28, 2020 · 16 comments
Assignees
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author TF 2.2 Issues related to TF 2.2 type:build/install Build and install issues

Comments

@mirekphd
Copy link

System information

  • TensorFlow installed from (source or binary): binary
  • TensorFlow version: 2.2.0
  • Python version: 3.7
  • Installed using: pip

Describe the problem
Pinned scipy dependency. Accepted requirements should be greater than or equal to the version tested by devs, but here are just equal (currently pinned to 1.4.1).

Provide the exact sequence of commands / steps that you executed before running into the problem

pip install scipy
pip install tensorflow

Any other info / logs

ERROR: tensorflow 2.2.0 has requirement scipy==1.4.1; python_version >= "3", but you'll have scipy 1.5.0 which is incompatible.
@mirekphd mirekphd added the type:build/install Build and install issues label Jun 28, 2020
@mihaimaruseac
Copy link
Collaborator

Can you make a PR to completely remove the dependency please?

See also #35709 and #40789

@mirekphd
Copy link
Author

@mihaimaruseac - I did not realize it can be an even greater bug, i.e. an unused dependency... I can only report the mismatch of requirements with the latest version of this dependency, and an easy workaround - replacing the first equality sign in the requirements file with a "greater than" sign:) Are we absolutely sure the dependency is unused?

@mihaimaruseac
Copy link
Collaborator

A few months ago it was unused. I'm quite confident it is unused now too.

@Saduf2019 Saduf2019 added stat:awaiting response Status - Awaiting response from author TF 2.2 Issues related to TF 2.2 and removed stat:awaiting response Status - Awaiting response from author labels Jun 29, 2020
@mirekphd
Copy link
Author

mirekphd commented Jul 4, 2020

A few months ago it was unused. I'm quite confident it is unused now too.

I think some unit tests would fail if the user had no scipy package pre-installed. But you may argue they are to be run only at build time and thus not needed on the typical user machine.... unless she does the build + tests herself.

Some tests where scipy is required:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/kernel_tests/random/random_binomial_test.py#L53
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/utils/composite_tensor_support_test.py#L386
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/kernel_tests/distributions/student_t_test.py#L46

@mihaimaruseac
Copy link
Collaborator

Yes, scipy is used only at test time. It should not show as install dependency in setup.py though.

@Saduf2019
Copy link
Contributor

@mirekphd
Please update as per above comment.

@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler google-ml-butler bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Jul 13, 2020
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@stonebig
Copy link

stonebig commented Jul 27, 2020

hum, the scipy==1.4.2 dependancy is apparently not removed in Tensorflow_cpu-2.3.0rc2. is it normal ?

@mihaimaruseac
Copy link
Collaborator

The r2.3 branch used for the 2.3 release has

# scipy < 1.4.1 causes segfaults due to pybind11
'scipy == 1.4.1',

The relaxation only occurred on master.

@stonebig
Copy link

stonebig commented Jul 27, 2020

it may become a problem when pip new strict resolver comes in full force this fall 2020. Is there any hope to remove it for final 2.3.0 ?

@mihaimaruseac
Copy link
Collaborator

Unfortunately we have started the final build steps, so we can only attempt removal on a subsequent patch release.

@jklaise
Copy link

jklaise commented Jul 29, 2020

Can we re-open this issue so it doesn't get lost?

This was referenced Jul 29, 2020
@mihaimaruseac
Copy link
Collaborator

Did it in a better way. Now, if there is a patch release for any of the affected branches the scipy pinning will also be removed.

@matthewfeickert
Copy link

matthewfeickert commented Jul 29, 2020

Did it in a better way. Now, if there is a patch release for any of the affected branches the scipy pinning will also be removed.

Thanks very much for fixing this (really fast too! 🚀), as this is keeping pyhf from using TensorFlow Probability v0.11.0. 👍

@Darsh-Dev
Copy link

Darsh-Dev commented Nov 3, 2020

I'm seeing similar issue on aarch64 platform.
tensorflow 2.3.0 requires scipy==1.4.1, but you'll have scipy 1.5.3 which is incompatible

Getting error:
Traceback (most recent call last):
File "face_recognition_pymodule_sklearn.py", line 26, in
from sklearn.preprocessing import LabelEncoder
File "/usr/lib/python3.7/site-packages/sklearn/init.py", line 134, in
from .base import clone
File "/usr/lib/python3.7/site-packages/sklearn/base.py", line 11, in
from scipy import sparse
File "/usr/lib/python3.7/site-packages/scipy/init.py", line 151, in
from scipy._lib._ccallback import LowLevelCallable
File "/usr/lib/python3.7/site-packages/scipy/_lib/_ccallback.py", line 1, in
from . import _ccallback_c
ImportError: cannot import name '_ccallback_c' from 'scipy._lib' (/usr/lib/python3.7/site-packages/scipy/_lib/init.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author TF 2.2 Issues related to TF 2.2 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

7 participants