Pyhthon imports in IntelliJ...... Local imports working yet giving error

Answered

I used to use PyCharm to do coding for school projects
I have decided to switch to intelliJ so that i can do python, html, css, javascript etc without having to switch from program to program each time.
a project uses a local python package structured as follows:

-project_08
                - mods

                            - __init__
                - swap_even_odd.py
                - min_max.py

using the code 

from mods import *

i was able to import the underlying functions without any errors

switching to intelliJ, the code still runs fine but the import is not recognised by IntelliJ
how do i fix this?

1
3 comments

Do you use the latest version (2021.3 at the moment)?

0

yes, i am using latest version 2021.3

 

1

Does marking Term 2 Practicals as Sources Root help? (right-click the folder and choose Mark Directory as -> Sources Root)

0

Please sign in to leave a comment.