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

ImportError: cannot import name 'entropy' from 'wafo.stats._distn_infrastructure' #52

Closed
Cubostar opened this issue Jan 31, 2022 · 4 comments

Comments

@Cubostar
Copy link

After installing wafo on an Anaconda Python 3.7 environment with help from this thread, I tried import wafo and got the titular error. Any fix?

@Cubostar
Copy link
Author

Cubostar commented Jan 31, 2022

The version I've tried to install is 0.4.0. Here's the full trace, though with the path in the first call omitted:

`Traceback (most recent call last):

File "{omitted}", line 1, in
import wafo

File "C:\Users\qarbolante\Anaconda3\envs\wafobuild37\lib\site-packages\wafo_init_.py", line 7, in
from . import objects

File "C:\Users\qarbolante\Anaconda3\envs\wafobuild37\lib\site-packages\wafo\objects.py", line 15, in
from wafo.transform.core import TrData

File "C:\Users\qarbolante\Anaconda3\envs\wafobuild37\lib\site-packages\wafo\transform_init_.py", line 7, in
from . import estimation

File "C:\Users\qarbolante\Anaconda3\envs\wafobuild37\lib\site-packages\wafo\transform\estimation.py", line 8, in
from wafo.stats import edf, skew, kurtosis

File "C:\Users\qarbolante\Anaconda3\envs\wafobuild37\lib\site-packages\wafo\stats_init_.py", line 6, in
from .distributions import *

File "C:\Users\qarbolante\Anaconda3\envs\wafobuild37\lib\site-packages\wafo\stats\distributions.py", line 10, in
from ._distn_infrastructure import entropy, rv_discrete, rv_continuous, rv_frozen`

@justaPCWingo
Copy link

Hi @Cubostar , I ran into this recently as well. The solution I found was to add the line from scipy.stats import entropy to the import block to the top of the wafo/stats/_distn_infrastructure.py.

It appears that pywafo was relying on the entropy objecting being imported with the glob statement from scipy.stats._distn_infrastructure import *, which no longer appears to work.

@ocefpaf
Copy link
Contributor

ocefpaf commented Mar 6, 2023

This was probably fixed in #54.

@davidovitch
Copy link
Member

Indeed, it should have. Please report back if it hasn't.

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