0

File "C:\Users\sande\OneDrive\Desktop\two.py", line 8, in import score.py

ModuleNotFoundError: No module named 'score.py'; 'score' is not a package

2 Answers2

0

You can solve this issue by using this:

import score

If this score.py is not is not in same folder as your two.py then visit How to import the class within the same directory or sub directory to solve that issue.

imxitiz
  • 3,920
  • 3
  • 9
  • 33
0

Don't use import scope.py, if you are having problem importing try import scope (if both the files are in the same directory) or if the files are in different directories you can use the sys module in python

# importing sys
import sys

# adding Folder_2 to the system path
sys.path.insert(0, '/C:/Users/sande/OneDrive/{drive/folder}/scope.py')

# importing the functions/class

If you are still getting the error, try removing

if name == "main":

yashsh
  • 81
  • 11