Hey,

> Pylint unable to find packages inside the folder(tree).
> The folder structure
>                 app
>                                 • utils
>                                                 • utils
>                                                                 • some 
> function
> 
> Statement: from app.utils.utils import some function
> Error: Unable to import 'app.utils.utils’
> 
> This path works fine with python but pylint throws the error, can you please 
> help with the issue?

Can you show a complete, runnable example instead of a vague description
that has other issues? (your import statement above is a SyntaxError).
See http://www.sscce.org/

This works fine:

$ mkdir -p app/utils
$ echo "def some_function(): pass" > app/utils/utils.py
$ echo "from app.utils.utils import some_function" > main.py

$ tree
.
├── app
│   └── utils
│       └── utils.py
└── main.py

3 directories, 2 files

$ pylint main.py
************* Module main

main.py:1:0: C0114: Missing module docstring (missing-module-docstring)
main.py:1:0: W0611: Unused some_function imported from app.utils.utils
(unused-import)

-----------------------------------
Your code has been rated at 0.00/10

$ pylint --version
pylint 2.17.4
astroid 2.15.5
Python 3.11.4 (main, Jun  8 2023, 11:01:33) [GCC 13.1.1 20230429]

> Any further use, dissemination, distribution or reproduction of this
> message is strictly prohibited.

I know this is just the default disclaimer by your employer, but note
you're sending this to a public mailing list which will absolutely cause
it to be distributed and publicly archived.

Florian

Attachment: pgpEH1ha3DeVd.pgp
Description: PGP signature

_______________________________________________
code-quality mailing list -- code-quality@python.org
To unsubscribe send an email to code-quality-le...@python.org
https://mail.python.org/mailman3/lists/code-quality.python.org/
Member address: arch...@mail-archive.com

Reply via email to