Python Forum
How to resolve scipy differences? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: How to resolve scipy differences? (/thread-21470.html)



How to resolve scipy differences? - Oliver - Oct-01-2019

In Pycharm, I am importing "import scipy.misc" and the code that calls scipy.misc.comb(...) works fine. The scipy version in Pycharm is 0.19.1.

Now, if I run that same code on the command line with scipy 1.3.1 (current version), I get this error:

AttributeError: module 'scipy.misc' has no attribute 'comb'

I'm confused about how to resolve this error since it works in PyCharm, but not at the command line with what appears to be the latest scipy version.

Thanks in advance,

-O


RE: How to resolve scipy differences? - buran - Oct-01-2019

As you can see in the docs, importing comb from scipy.misc was depreciated in 1.0.0. You need to import it from scipy.special:
https://docs.scipy.org/doc/scipy-1.2.1/reference/misc.html

Quote:comb is deprecated! Importing comb from scipy.misc is deprecated in scipy 1.0.0.

It was an alias so if you import from scipy.special it should work in both versions. Of course the question why you use two different versions is warnted. It looks like you use one python interpreter in pycharm and other from command line. I would advise to sort out the different python interpreters/installations you have


RE: How to resolve scipy differences? - Oliver - Oct-08-2019

Thanks. I also found the right library to use instead. :)

Appreciate your reply.