I am learning how to use VS code and in the process, I learnt about linting and formatting with "pylint"
and "black"
respectively.
Importantly, I have Anaconda installed as I often use conda environments for my different projects. I have therefore installed "pylint"
and "black"
into my conda environment.
My questions are as follows:
"pylint"
and "black"
are Python packages, why do they not need to be imported into your script when you use them? (ie "import pylint"
and "import black"
at the top of a Python script you want to run). I am very new to VS code, linting and formatting so maybe I'm missing something obvious but how does VS code know what to do when I select "Run Linting" or "Format document" in the command palette? Or is this nothing to do with VS code ?I guess I am just suprised at the fact we don't need to import these packages to use them. In contrast you would always be using import for other packages (sys, os, or any other).
black
and pylint
are only available in the conda environment you installed them in. You can find them in the "Scripts"-folder of your environment.import
python modules or functions that you want to use inside your python module. But that's not what you do.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.