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

bivariate_normal function has been removed from matplotlib #48

Open
DaisyLyu522 opened this issue May 30, 2024 · 1 comment
Open

bivariate_normal function has been removed from matplotlib #48

DaisyLyu522 opened this issue May 30, 2024 · 1 comment

Comments

@DaisyLyu522
Copy link

DaisyLyu522 commented May 30, 2024

Hello,
I am trying to run swifr_train and it gives me the error:
Traceback (most recent call last): File "/home/anaconda3/bin/swifr_train", line 5, in <module> from swifr_pkg.SWIFr_train import main File "/home/anaconda3/lib/python3.11/site-packages/swifr_pkg/SWIFr_train.py", line 13, in <module> from matplotlib.mlab import bivariate_normal ImportError: cannot import name 'bivariate_normal' from 'matplotlib.mlab' (/home/anaconda3/lib/python3.11/site-packages/matplotlib/mlab.py)

I noticed that bivariate_normal function has been removed from matplotlib, so I modify the from matplotlib.mlab import bivariate_normal to be from scipy.stats import multivariate_normal.

After this modification, I ran swifr_train again and receive another error:
Traceback (most recent call last): File "/home/anaconda3/bin/swifr_train", line 5, in <module> from swifr_pkg.SWIFr_train import main File "/home/anaconda3/lib/python3.11/site-packages/swifr_pkg/SWIFr_train.py", line 14, in <module> from matplotlib.mlab import normpdf ImportError: cannot import name 'normpdf' from 'matplotlib.mlab' (/home/anaconda3/lib/python3.11/site-packages/matplotlib/mlab.py)

It seems that some packages have been removed from the matplotlib. I can search for alternative and modify the code but I'm worrying that it cause some issues. Do you have any suggestions?

As for reference, when installing swifr, I received the error:
`[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for scipy
Running setup.py clean for scipy
error: subprocess-exited-with-error

× python setup.py clean did not run successfully.
│ exit code: 1
╰─> [9 lines of output]

  setup.py clean is not supported, use one of the following instead:
  
    - git clean -xdf (cleans all files)
    - git clean -Xdf (cleans all versioned files, doesn't touch
                        files that aren't checked into the git repo)
  
  Add --force to your command to use it anyway if you must (unsupported).
  
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed cleaning build dir for scipy
Failed to build numpy scikit-learn scipy
ERROR: Could not build wheels for numpy, scikit-learn, scipy, which is required to install pyproject.toml-based projects`

So I uninstalled numpy and installed swifr with code below:
pip install -U numpy
pip install --no-deps swifr

@hmsnell
Copy link
Contributor

hmsnell commented Jun 27, 2024

should be fixed with most updated version of SWIF(r) v. 2.2.1!

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

2 participants