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

Mglearn : Memory(cachedir="cache") #162

Closed
Matthieu0202 opened this issue Sep 29, 2022 · 8 comments · Fixed by #165
Closed

Mglearn : Memory(cachedir="cache") #162

Matthieu0202 opened this issue Sep 29, 2022 · 8 comments · Fixed by #165

Comments

@Matthieu0202
Copy link

hello,

When i try to import mglearn : i have this message error :

"3 import numpy as np
5 from joblib import Memory
----> 7 memory = Memory(cachedir="cache")
10 def plot_pca_illustration():"
TypeError: Memory.init() got an unexpected keyword argument 'cachedir'

Can you tell me how to fix it ?

Thx

@sdempwolf
Copy link

hello,
Several of my students had this issue as well, but not all. There is an open issue on stackoverflow that provides a little more information. It apparently has something to do with a recent update to hdbscan on Sep 16 2022. Students (and me) who downloaded prior to that date are not having the problem. here is the link: https://stackoverflow.com/questions/73830225/init-got-an-unexpected-keyword-argument-cachedir-when-importing-top2vec. My short-term solution was to point my students to my fork on GitHub that still has the old version. You are welcome to it but it also has a few changes I've made for my course. All original files are intact, but I have a few extras.

@tingwang97077
Copy link

Hello, I have the same issue

my solution :

  • go to the directory python3.9/sites-packages/mglearn
  • find the files plot_pca.py and plot_nmf.py
  • change the line memory = Memory(cachedir="cache") into memory = Memory(location="cache")
    because in the joblib packages the option location replaces cachedir since version 0.12 and that works for me.

I hope this will help you and also other people.

@Matthieu0202
Copy link
Author

Thank you the 2 solutions works !

@muhammadjtareen
Copy link

@tingwang97077 dude you are a lifesaver! this worked for me too! Thanks so much for the help!

@sayfee
Copy link

sayfee commented Nov 22, 2022

How would you fix this in notebooks? I am running it on google colab

@sayfee
Copy link

sayfee commented Nov 23, 2022

running this fixes it:
!pip install joblib==1.1.0

@acemacdonald
Copy link

I've tried all the options above

I'm using a Jupyter Notebook inside vs code where I'm running a Python 3.12.2 kernel. I install mglearn and when I run the following

import mglearn

I get the folliwing error message:

OSError: [Errno 30] Read-only file system: 'cache'

Would appreciate any help on this. I've even gone into the files mentioned above and changed the code there. If I try install a previous version if joblib it still gives me the above mentioned Errno 30

@wanghedy
Copy link

wanghedy commented May 6, 2024 via email

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

Successfully merging a pull request may close this issue.

7 participants