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

Scipy version update causes error importing 'bmat' #770

Open
jamjahal opened this issue May 16, 2021 · 3 comments
Open

Scipy version update causes error importing 'bmat' #770

jamjahal opened this issue May 16, 2021 · 3 comments

Comments

@jamjahal
Copy link

Hi, When importing imgaug i get the error cannot import 'bmat' from 'scipy.sparse.sputils'. Looking at the traceback error shows that the file /opt/anaconda3/envs/deep_learning/lib/python3.8/site-packages/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py is attempting to import bmat from ---> 24 from scipy.sparse.sputils import bmat.

bmat has apparently been moved to scipy.sparse.bmat. Changing this line in the above file solved the error.

scipy = 1.5.4
python = 3.8.0
imgaug = 0.4.0

@hoult14
Copy link

hoult14 commented Jun 2, 2022

I have the same question, so how do you solve this problem?

@mrevow
Copy link

mrevow commented Jul 27, 2022

I just ran into the same issue after upgrading my scipy version. I got
ImportError: cannot import name 'bmat' from 'scipy.sparse.sputils'

It turns out that this commit renamed scipy/sparse/linalg/eigen -> scipy/sparse/linalg/_eigen When I upgraded the, old directory did not get deleted. I ended up with both _eigen and eigen. Python was loading the the old version

I just renamed site-packages/scipy/sparse/linalg/eigen -> site-packages/scipy/sparse/linalg/eigenDeprecated in my installation which fixed the issue

@big-sha-fang
Copy link

the error happens because 'bmat' is moved to 'numpy'.
solution: open 'scipy/sparse/linalg/eigen/lobpcg/lobpcg.py' and change 'import bmat from 'scipy.sparse.sputils' to 'import bmat from numpy'

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

4 participants