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] Linesearch hidden in scipy 1.14 #641

Closed
rflamary opened this issue Jun 25, 2024 · 1 comment · Fixed by #642
Closed

[Bug] Linesearch hidden in scipy 1.14 #641

rflamary opened this issue Jun 25, 2024 · 1 comment · Fixed by #642

Comments

@rflamary
Copy link
Collaborator

Describe the bug

Testing with most recent scipy leads to the following error

Run python -m pytest --durations=20 -v test/ ot/ --color=yes --cov=./ --cov-report=xml
ImportError while loading conftest '/home/runner/work/POT/POT/test/conftest.py'.
test/conftest.py:[11](https://github.com/PythonOT/POT/actions/runs/9657485158/job/26636841070?pr=640#step:6:12): in <module>
    from ot.backend import get_backend_list, jax, tf
ot/__init__.py:23: in <module>
    from . import optim
ot/optim.py:22: in <module>
    from scipy.optimize.linesearch import scalar_search_armijo
E   ImportError: cannot import name 'scalar_search_armijo' from 'scipy.optimize.linesearch' (/opt/hostedtoolcache/Python/3.10.[14](https://github.com/PythonOT/POT/actions/runs/9657485158/job/26636841070?pr=640#step:6:15)/x64/lib/python3.10/site-packages/scipy/optimize/linesearch.py)
Error: Process completed with exit code 4.

One needs to import now from teh hiden submodule scipy.optimize._linesearch``

To Reproduce

Steps to reproduce the behavior:

  1. ...

Screenshots

Code sample

Expected behavior

Environment (please complete the following information):

  • OS (e.g. MacOS, Windows, Linux):
  • Python version:
  • How was POT installed (source, pip, conda):
  • Build command you used (if compiling from source):
  • Only for GPU related bugs:
    • CUDA version:
    • GPU models and configuration:
    • Any other relevant information:

Output of the following code snippet:

import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import scipy; print("SciPy", scipy.__version__)
import ot; print("POT", ot.__version__)

Additional context

@TakumiOtagaki
Copy link

TakumiOtagaki commented Jun 25, 2024

I found that
scipy 13.1 & pot 0.9.3 & numpy=1.26.4 works but scipy 1.14.0 & pot 0.0.3 & numpy 2.0.0 does not work.

After

pip uninstall scipy numpy
pip install scipy==1.13.1 numpy=1.26.4

it worked well.

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

Successfully merging a pull request may close this issue.

2 participants