function import from another python file in another directory /u/Wonderful-Tell9643 Python Education

hello guys, i have this problem to import a function called get_current_user from a file called security.py , im working on main.py file and i when i try to import the function that i want using this import

….auth_service.core.security import oauth2_scheme, get_current_user

i get this error

File "C:UsersUserDocumentsworkWeb-Appbackendmicroservicespassword_analyzerappmain.py", line 4, in <module> from ....auth_service.core.security import oauth2_scheme, get_current_user ImportError: attempted relative import with no known parent package ├── backend/ │ ├── auth_service/ │ │ ├── core/ │ │ │ ├── security.py │ └── microservices/ │ ├── analyzer/ │ │ ├── app/ │ │ │ ├── main.py │ │ │ └── utils.py 

submitted by /u/Wonderful-Tell9643
[link] [comments]

​r/learnpython hello guys, i have this problem to import a function called get_current_user from a file called security.py , im working on main.py file and i when i try to import the function that i want using this import ….auth_service.core.security import oauth2_scheme, get_current_user i get this error File “C:UsersUserDocumentsworkWeb-Appbackendmicroservicespassword_analyzerappmain.py”, line 4, in <module> from ….auth_service.core.security import oauth2_scheme, get_current_user ImportError: attempted relative import with no known parent package ├── backend/ │ ├── auth_service/ │ │ ├── core/ │ │ │ ├── security.py │ └── microservices/ │ ├── analyzer/ │ │ ├── app/ │ │ │ ├── main.py │ │ │ └── utils.py submitted by /u/Wonderful-Tell9643 [link] [comments] 

hello guys, i have this problem to import a function called get_current_user from a file called security.py , im working on main.py file and i when i try to import the function that i want using this import

….auth_service.core.security import oauth2_scheme, get_current_user

i get this error

File "C:UsersUserDocumentsworkWeb-Appbackendmicroservicespassword_analyzerappmain.py", line 4, in <module> from ....auth_service.core.security import oauth2_scheme, get_current_user ImportError: attempted relative import with no known parent package ├── backend/ │ ├── auth_service/ │ │ ├── core/ │ │ │ ├── security.py │ └── microservices/ │ ├── analyzer/ │ │ ├── app/ │ │ │ ├── main.py │ │ │ └── utils.py 

submitted by /u/Wonderful-Tell9643
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *