Python Forum
How to resolve scipy differences?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to resolve scipy differences?
#1
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
Reply
#2
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/r.../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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

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

Appreciate your reply.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pandas and Date: problem with operator.How to resolve frame 6 4,474 May-13-2019, 05:50 PM
Last Post: frame

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020