Tag Archives: Pylint

An import error is reported in the python. The solution to setting. Pylintrc is invalid

/. Pylintrc problem

because of vs code
, unable to import, searched the pylint setting on the Internet and used the Suggestions in many articles
Pylintrc . Pylintrc set init-hook initialization sys.path method. But no matter how you set it up, those errors don’t go away. Out of the spirit of not giving up until solving the problem, I finally found:

Originally I put the source code on the desktop, python with conda configured virtual environment. Then I ignorantly put . Pylintrc in the folder Scripts and pylint.exe.
Put the RC file on the desktop and solve the problem.

init-hook='import sys; sys.path.append("C:/MySoftware/Miniconda3/envs/tf_env/Lib/site-packages/")'

Just to make fun of how detailed the tutorials are and how elaborate the stuff behind init-hook is without making it clear how the working folder is related to the RC file, resulting in the RC file being set up but not being found by Pylint. Misbehaving! In the official website, the order of pylint to find RC files is clearly written, but it is too inconspicuous, so I searched for a long time.
I like the idea of putting it in a working folder so that each code file can personalize the path it is looking for.