pylint-pycharm icon indicating copy to clipboard operation
pylint-pycharm copied to clipboard

Plugin Doesn't Use Interpreter's PYTHONPATH

Open JonnoFTW opened this issue 2 years ago • 0 comments

Step 1: Are you in the right place?

  • [x] I have verified there are no duplicate active or recent bugs, questions, or requests
  • [x] I have verified that I am using the latest version of the plugin.

Step 2: Describe your environment

  • Plugin version: 0.14.0
  • PyCharm/IDEA version: 2021.3.2 Professional Edition
  • Pylint version: 2.12.2

Step 3: Describe the problem:

Pylint plugin does not set PYTHONATH when running pylint. import-error will be returned for lines that would normally work because they are set in the project interpreter's custom PYTHONPATH. A typical use case is when I am using a git submodule and want to import code from it.

The plugin also does not give a way to manually pass environment variables to the pylint call

Steps to reproduce:

  1. Include code in subdirectory of project, eg. lib
  2. Add lib to pythonpath of interpreter: File -> Settings -> Project -> Python Interpreter -> Cog Icon -> Show All -> Show Paths (last icon in the top bar) -> + Icon -> Select Path of lib. Save settings
  3. Run pylint plugin
  4. You will get import errors for modules in lib

Observed Results:

  • Import Errors are returned (the swagger_client folder is under api_test/lib in the below screenshots)

image

image

Expected Results:

  • No import errors

JonnoFTW avatar Mar 16 '22 00:03 JonnoFTW