pylint doesn't point to virtualenv python

后端 未结 10 1832
执笔经年
执笔经年 2021-01-07 19:19

I am pretty new to python and currenty I am trying to use pylint for checking code quality. I am getting a problem. My pylint doesn\'t point to virtualenv python interpreter

10条回答
  •  醉酒成梦
    2021-01-07 19:32

    I am fairly sure that you need to install pylint under your virtual environment and then run that instance of it.

    Update - Make life easier:

    I would suggest that anybody working a lot in virtual environments create a batch file, (in a known location or on the path), or bash script with something like the following called something like getlint.bat:

    pip install pylint
    

    Invoking this after activating the virtual environment will install pylint into that virtual environment. If you are likely to be offline or have a poor internet connection you can, once when you have a good internet connection, (possibly once for each of python 2 & 3):

    mkdir C:\Some\Directory\You\Will\Leave\Alone
    pip download --dest=C:\Some\Directory\You\Will\Leave\Alone pylint
    

    Which will download pylint and its dependencies to C:\Some\Directory\You\Will\Leave\Alone and you can modify getlint.bat to read:

    pip install pylint --find-links=C:\Some\Directory\You\Will\Leave\Alone
    

    It will then use the pre-downloaded versions.

提交回复
热议问题