Skip to content

2018.3.0: Pylint: 'F0001:No module named "test.py"' appears in every file with a path that has a space #1239

Closed

Description

@garyking

Since installing the 2018.3.0 version of this extension about an hour ago, I get 'F0001:No module named "test.py"' at the top of every module from pylint (for line 1, character 1), with test.py being replaced with the file's filename.

This happens even if the file is the only file in its dir. This also only happens with existing VS Code projects, but not new ones.

This is definitely related to this extension and pylint. Because when I copy my project to a new folder, then open it in VSC, these errors disappear. But the original project location still has these errors.

This makes it incredibly difficult to fix on my own, since I don't know where to look, with regards to VSC. It must be something to do with an internal VS Code database?

Edit: As noted here, this problem only happens with paths with spaces in them. I was able to reproduce this myself.

Activity

  1. dhruvmhjn commented on Mar 29, 2018

    @dhruvmhjn

    Yup, I just noticed the exact same issue.

  2. amyspark commented on Mar 29, 2018

    @amyspark

    I'm getting this error only from projects with spaces in their paths, either new or existing. Can anyone check if this is the case too?
    (VS Code 1.22.0-insider on Sierra)

  3. garyking commented on Mar 29, 2018

    @garyking
    Author

    I'm getting this error only from projects with spaces in their paths, either new or existing.

    Excellent observation! This is the answer. I was able to reproduce.

    I was testing in a path with no space. I added a space. Immediate error. Should be an easy fix in the extension though, but otherwise there isn't anything we can do on our end unfortunately.

  4. changed the title [-]Since installing 2018.3.0, I get 'F0001:No module named "test.py"' at the top of every module from pylint.[/-] [+]2018.3.0: Pylint: 'F0001:No module named "test.py"' appears in every file with a path that has a space[/+] on Mar 29, 2018
  5. brettcannon commented on Mar 29, 2018

    @brettcannon
    Member

    We can reproduce on our end. We're trying to figure out the root cause.

  6. chikaobuah commented on Mar 29, 2018

    @chikaobuah

    Getting same issue too. The latest update is full of bugs.

  7. kevin-he-01 commented on Mar 29, 2018

    @kevin-he-01

    I also experienced this problem.
    I also went to the OUTPUT tab at the bottom of the editor found out what actually caused the error.

    Assume that /Path with space/to/your/source_code.py is the path to your module source_code
    I see:

    ************* Module "/Path with space/to/your/source_code.py"
    1,0,fatal,F0001:No module named "source_code.py"
    

    but when I run it from the command line, I see:
    ************* Module source_code
    (Followed by lint feedbacks...)

    That means the module is resolved incorrectly when there's a space in the path so VS Code has to quote it. Pylint is confused about the quotes VS Code gives it and treat the path with quotes and .py as a module, no wonder the module is not found

    Strangely, even when I run the command pylint "/Path with space/to/your/source_code.py" instead of pylint source_code in the directory containing source_code.py, the module is resolved correctly

  8. chikaobuah commented on Mar 29, 2018

    @chikaobuah

    How can I uninstall or opt out of latest update?

  9. DonJayamanne commented on Mar 29, 2018

    @DonJayamanne

    Chika (@chikaobuah) We're in the process of fixing this. A hot fix will be release soon.
    Apologies for the inconvenience.

  10. shaharpit191 commented on Mar 29, 2018

    @shaharpit191

    You will also find the same error if your name contains any numbers. I removed numbers from my file name and it worked.

  11. brettcannon commented on Mar 29, 2018

    @brettcannon
    Member

    Quick update: we are waiting for tests to complete on our fix and then we will push out a hotfix release. We are hoping to have all of this resolved in the next 30 minutes.

  12. brettcannon commented on Mar 29, 2018

    @brettcannon
    Member

    OK, 2018.3.1 is now live with a fix for this! Sorry everyone for letting this slip out.

  13. dhruvmhjn commented on Mar 30, 2018

    @dhruvmhjn

    My first experience reporting such a bug. That was quick. Thanks!

  14. added a commit that references this issue on Mar 30, 2018
    7823c7b
  15. locked as resolved and limited conversation to collaborators on Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-lintingbugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions