SkLearn Installation

Hi! I just need some help on how to install sklearn library on replit? For some reason when i try to run

!pip install scikit-learn

It comes back with a module error. Looking for some help and guidance. Sorry for the simple question, i a new to replit and coming from Juypter Notebooks.

Could well be that the storage is not enough.
Try again and check the storage bar

3 Likes

Welcome to the community!

Don’t use an exclamation in front of pip. If pip install skikit-learn does not work, try poetry add skikit-learn instead.

2 Likes

Yup I think that as @fpessolano said, Repls don’t have enough storage space…

psst… you can store files in home/runner/ and they do not take up any storage there

Yeah, but they get deleted on reboot.

2 Likes

thank you for the suggestion. I tried without the exclamamtion mark. still no luck. I am receiving this error?

Traceback (most recent call last):
File ā€œmain.pyā€, line 2, in
from sklearn.ensemble import RandomForestRegressor
ModuleNotFoundError: No module named ā€˜sklearn’
īŗ§

I’m not even gonna lie when I looked on pypi for the package, it had no docs nor a github linked so.

Neither does my pypi module. Of course mine needs major code improvements which I haven’t had time for…

I found docs and a GitHub on google.
@MattPilkington As the pypi page says, try this: pip install -U scikit-learn

That didn’t work for him so.

They used poetry, not pip. Also, there might have been an installation error that they have not given us.

I looked at the builds on pypi but none of them had actual SRC so.

EDIT: I’ve been looking at the wrong package this entire time :sob: :skull: .

@bigminiboss is it true that files in home/runner/ get deleted on reboot? Is that why the repl is always on?

2 Likes

lol probably yeah XD

2 Likes

Solution:

  1. Go to replit
  2. Open the repl or create repl
  3. Go to shell
  4. Write this code in shell
pip install sciket-learn

There you go problem is Solved
Here the link of offical sciket-learn
https://scikit-learn.org/stable/
Installation Link

You need to import sklearn

They did, as you can see from the error XD

2 Likes

They did this already. :sob:

1 Like

ok @functionally :smile:
got it

1 Like