question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Absolute paths do not seem to work for pylint executable discovery

See original GitHub issue

Step 1: Are you in the right place?

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

Step 2: Describe your environment

  • Plugin version: 0.11.0
  • PyCharm/IDEA version: Pycharm 2019.1.3
  • Pylint version: 2.3.1

Step 3: Describe the problem:

Steps to reproduce:

  1. Python project uses a virtual environment
  2. An absolute path is given to the pylint plugin (either manually or automatically)
  3. It is unable to find the executable.

Observed Results:

  • The executable was not found, it seems to expect a relative path based on the project source, not an absolute path
java.lang.Throwable: Error while checking Pylint path D:/repos/daydream3.5\D:/python_venv/daydream3.5/Scripts/pylint.exe: null or not exists
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:145)
	at com.leinardi.pycharm.pylint.plapi.PylintRunner.isPylintPathValid(PylintRunner.java:85)
	at com.leinardi.pycharm.pylint.plapi.PylintRunner.checkPylintAvailable(PylintRunner.java:177)
	at com.leinardi.pycharm.pylint.plapi.PylintRunner.scan(PylintRunner.java:230)
	at com.leinardi.pycharm.pylint.checker.ScanFiles.scan(ScanFiles.java:108)
	at com.leinardi.pycharm.pylint.checker.ScanFiles.checkFiles(ScanFiles.java:100)
	at com.leinardi.pycharm.pylint.checker.ScanFiles.call(ScanFiles.java:74)
	at com.leinardi.pycharm.pylint.checker.ScanFiles.call(ScanFiles.java:46)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.call(ApplicationImpl.java:339)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

Expected Results:

  • The executable should have been found

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kaziecommented, Dec 11, 2021

Yeah, I did that now now exploring the gradle tasks for a named candidate (buildPlugin under intellij was kind of obvious once I saw it), built the zip file and installed on the windows machine. And it seems to work. 😃 Putting up a PR soon for it. Thanks you for your excellent work and replies overall!

1reaction
kaziecommented, Dec 11, 2021

I tested locally to do this change:

diff --git a/src/main/java/com/leinardi/pycharm/pylint/plapi/PylintRunner.java b/src/main/java/com/leinardi/pycharm/pylint/plapi/PylintRunner.java
index 798480b..d24db0f 100644
--- a/src/main/java/com/leinardi/pycharm/pylint/plapi/PylintRunner.java
+++ b/src/main/java/com/leinardi/pycharm/pylint/plapi/PylintRunner.java
@@ -140,7 +140,7 @@ public class PylintRunner {
             VirtualFile pylintFile = LocalFileSystem.getInstance()
                     .findFileByPath(interpreterFile.getParent().getPath() + File.separator + PYLINT_EXECUTABLE_NAME);
             if (pylintFile != null && pylintFile.exists()) {
-                return pylintFile.getPath();
+                return pylintFile.getPresentableUrl();
             }
         } else {
             return detectSystemPylintPath();

And it seems to work for windows machines: show_instead_of_virtual_path

Read more comments on GitHub >

github_iconTop Results From Across the Web

PyLint "Unable to import" error - how to set PYTHONPATH?
There are two options I'm aware of. One, change the PYTHONPATH environment variable to include the directory above your module.
Read more >
Settings Reference for Python - Visual Studio Code
Python settings reference. The Python Extension for Visual Studio Code is highly configurable. This page describes the key settings you can work with....
Read more >
Editor and IDE integration — Pylint 2.11.1 documentation
If the plugin is not finding the Pylint executable (e.g. is not inside the PATH environmental variable), you can specify it manually using ......
Read more >
PyInstaller Documentation - Read the Docs
Open a command prompt/shell window, and navigate to the directory where your .py file is located, then build your app with the following...
Read more >
Configuration - tox
tox configuration can be split into two categories: core and environment ... option and is not available under testenv:{env_name} will first try to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found