Ask coding questions

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

So this file tries to import my classes from the other file: does this: 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 package installation failed!

Why is it trying to install something here?

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

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

from main import TomeRater

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