Ask coding questions

← Back to all posts
Pyhton import of class failed (I think), repl.it wants to install new package but fails
bennypr0fane (0)

So this populate.py file tries to import my classes from the other file:
https://repl.it/@bennypr0fane/Tome-Rater
repl.it does this:

Repl.it: Installing fresh packages

Collecting TomeRater
  ERROR: Could not find a version that satisfies the requirement TomeRater (from versions: none)
ERROR: No matching distribution found for TomeRater


Repl.it: package installation failed!

Why is it trying to install something here?

Answered by Scoder12 (332) [earned 5 cycles]
View Answer
Commentshotnewtop
Scoder12 (332)

When you do from TomeRater import * it is trying to import from a file called tomerater.py but it doesn't exist, so repl.it assumes you are trying to install it. What you want to do here is

from main import TomeRater

I am a repl.it helper. If this helped you, please mark as answer and/or upvote!