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

[pymanopt] ImportError: cannot import name 'comb' from 'scipy.misc' #13

Open
lkorczowski opened this issue Jan 14, 2020 · 1 comment
Open
Labels
bug Something isn't working

Comments

@lkorczowski
Copy link
Collaborator

lkorczowski commented Jan 14, 2020

While the following error seems to be fixed months ago, whatever I do, I still have the error with my numpy-1.18.1 pymanopt-0.2.4 scipy-1.4.1 (force-reinstalled).

when

from pymanopt.manifolds import Grassmann

Traceback (most recent call last):
  File "/Users/louis/anaconda3/envs/timeflux_rasr-env/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3319, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-3-8b1d9e518ecd>", line 1, in <module>
    from pymanopt.manifolds import Grassmann
  File "/Applications/PyCharm CE with Anaconda plugin.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/Users/louis/anaconda3/envs/timeflux_rasr-env/lib/python3.7/site-packages/pymanopt/manifolds/__init__.py", line 11, in <module>
    from .rotations import Rotations
  File "/Applications/PyCharm CE with Anaconda plugin.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/Users/louis/anaconda3/envs/timeflux_rasr-env/lib/python3.7/site-packages/pymanopt/manifolds/rotations.py", line 10, in <module>
    from scipy.misc import comb
ImportError: cannot import name 'comb' from 'scipy.misc' (/Users/louis/anaconda3/envs/timeflux_rasr-env/lib/python3.7/site-packages/scipy/misc/__init__.py)

fix :
in pymanopt/manifolds/rotation.py change L10 to
from scipy.special import comb (instead of from scipy.misc)

The weirdest part: it has been fixed pymanopt/pymanopt#77

And my pymanopt is updated.

If you experience this error, please let me know by doing the following:
from pymanopt.manifolds import Grassmann

Thanks

Also: it's been a while I'm using pymanopt and I got this error just today :/, what could have modified my pymanopt ? (I did merge master in the pymanopt branch and this error happened for the first time when I was using pytest)

@lkorczowski lkorczowski added the bug Something isn't working label Jan 14, 2020
@anasMsaedwi
Copy link

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants