ide-python icon indicating copy to clipboard operation
ide-python copied to clipboard

Linting stops working or displaying in Atom with pyls > 0.31.2

Open hermidalc opened this issue 5 years ago • 35 comments

After upgrading pyls on conda-forge from 0.31.2 -> 0.31.3 or 0.31.4 then ide-python suddenly stops showing any lint comments/warnings/errors. When I downgrade back to 0.31.2 then everything shows up again.

Atom 1.42 (on linux) ide-python 1.5.0

hermidalc avatar Jan 08 '20 18:01 hermidalc

Me too, I can help the pack?

timmy61109 avatar Jan 09 '20 14:01 timmy61109

I also have this problem but I still didn't get the linting after downgrading pyls to 0.31.2. I wonder if anyone has a solution for this?

fangzhou-xie avatar Jan 13 '20 01:01 fangzhou-xie

But my Windows system works fine, which is quite strange.

However, this kit is also dependent on Facebook's Atom IDE UI, and Facebook also stopped maintaining this kit. Maybe we should find a way to move to other UI interfaces, or whether we can make improvements in the dependent Atom IDE UI.

timmy61109 avatar Jan 14 '20 10:01 timmy61109

I also have this problem but I still didn't get the linting after downgrading pyls to 0.31.2. I wonder if anyone has a solution for this?

Not sure how you had linting working with 0.31.2, then upgraded to 0.31.3 or 0.31.4 and lost it, then downgraded back to 0.31.2 and linting doesn't come back. I performed the upgrade and downgrade a few times to make sure it was the version upgrade causing the problem and with each downgrade to 0.31.2 linting worked again. I would check there isn't something else you've done that is causing your problem.

hermidalc avatar Jan 14 '20 17:01 hermidalc

I also have this problem but I still didn't get the linting after downgrading pyls to 0.31.2. I wonder if anyone has a solution for this?

Not sure how you had linting working with 0.31.2, then upgraded to 0.31.3 or 0.31.4 and lost it, then downgraded back to 0.31.2 and linting doesn't come back. I performed the upgrade and downgrade a few times to make sure it was the version upgrade causing the problem and with each downgrade to 0.31.2 linting worked again. I would check there isn't something else you've done that is causing your problem.

Thank you! I have typed the command python -m pip install 'python-language-server[all]' again and nothing was installed (because version 0.31.2 has been installed already). Weird though, I got the linting back in my Atom now!

I have no idea why did that happen but I am glad the linting is back! I love this feature and thank you!

fangzhou-xie avatar Jan 14 '20 19:01 fangzhou-xie

I installed ide-python for the first time and it does not work. I always get the message that pyls should be installed, but it is. I followed the instruction, even did the specific install of "0.31.2", as it seems to be the version that works for you. :)

When i to the command to check if it is installed (python -m pyls --help), I get:

usage: __main__.py [-h] [--tcp] [--host HOST] [--port PORT] [--check-parent-process] [--log-config LOG_CONFIG | --log-file LOG_FILE] [-v]

In the example in the README is says: usage: pyls instead of usage: __main__.py ... is there a problem and how do I fix it?

Faldrian avatar Feb 01 '20 17:02 Faldrian

I installed ide-python for the first time and it does not work. I always get the message that pyls should be installed, but it is. I followed the instruction, even did the specific install of "0.31.2", as it seems to be the version that works for you. :)

When i to the command to check if it is installed (python -m pyls --help), I get:

usage: __main__.py [-h] [--tcp] [--host HOST] [--port PORT] [--check-parent-process] [--log-config LOG_CONFIG | --log-file LOG_FILE] [-v]

In the example in the README is says: usage: pyls instead of usage: __main__.py ... is there a problem and how do I fix it?

I’m pretty sure your problem is different than what is described in this issue. Not even certain it’s ide-python could be pyls or something else in your local setup or install.

hermidalc avatar Feb 02 '20 03:02 hermidalc

I installed ide-python for the first time and it does not work. I always get the message that pyls should be installed, but it is. I followed the instruction, even did the specific install of "0.31.2", as it seems to be the version that works for you. :) When i to the command to check if it is installed (python -m pyls --help), I get: usage: __main__.py [-h] [--tcp] [--host HOST] [--port PORT] [--check-parent-process] [--log-config LOG_CONFIG | --log-file LOG_FILE] [-v] In the example in the README is says: usage: pyls instead of usage: __main__.py ... is there a problem and how do I fix it?

I’m pretty sure your problem is different than what is described in this issue. Not even certain it’s ide-python could be pyls or something else in your local setup or install.

crazy... I had to set the "Python Executable" to "/usr/bin/python" ... which is my default python which is called when you type "python". Thanks for the reply :)

Faldrian avatar Feb 02 '20 08:02 Faldrian

Same problem for me:

Global versions

  • Atom==1.44.0
  • ide-python==1.5.0
  • Linux OS: ubuntu==18.10

Tests

  • (1) python3.7 (in settings)
    • python3.7 -m pip install python-language-server==0.29.0 (minimum required version for the ide-python to work)
    • Result: error and warnings are displayed
  • (2) python3.7 (in settings)
    • python3.7 -m pip install python-language-server==0.31.2 (or newer, I haven't test all the version between 0.29.0 and 0.31.2)
    • Result: error and warnings are NOT displayed
  • (3) python3.8 (in settings)
    • python3.8 -m pip install python-language-server==0.29.0 (and same for 0.31.2)
    • Result: error and warnings are displayed, EDIT: But for 0.31.2, a removed previously displayed warning or error is still displayed
  • (4) python3.8 (in settings)
    • python3.8 -m pip install python-language-server==0.31.8 (or >= 0.31.3)
    • Result: error and warnings are NOT displayed

Thank you for your work

EDIT: It seems that pyflakes is broken with python 3.8 ... Associated log error: Python (pyls) stderr AttributeError: 'Checker' object has no attribute 'NAMEDEXPR'

https://github.com/PyCQA/pyflakes/pull/457

TEMPORARY SOLUTION: python3.8 -m pip uninstall pyflakes python3.8 -m pip install git+https://github.com/pycqa/pyflakes

vepain avatar Feb 25 '20 10:02 vepain

@lgeiger no pressure, just wondering out of interest, are you not going to maintain ide-python anymore given that atom-ide-ui isn't developed and maintained by Facebook anymore?

I think atom-ide-ui, the language server protocol, and packages for each language based off it were some of the best things about Atom, including ide-python. I only had to install one conda package and one Atom package for each language I use and it came loaded with everything you need. Before that I had to install and set up a pair of packages for each individual programming tool I wanted. I guess I could go back to that.

hermidalc avatar Mar 02 '20 05:03 hermidalc

@lgeiger no pressure, just wondering out of interest, are you not going to maintain ide-python anymore given that atom-ide-ui isn't developed and maintained by Facebook anymore?

@hermidalc Thanks for asking. I agree ide-python hasn't received enough attention from my side lately. Largely due to the fact that I now have a full time job instead of being a lazy student, I no longer have so much time and energy to maintain ide-python and answer issues. However this doesn't mean the project is abandoned. I still use it on a daily basis and will provide critical fixes, merge PRs or add support for new features from the language server. I really encourage everyone who is interested in seeing this project evolve further, to keep answering questions and help to improve the documentation and user experience of ide-python. I am more than happy to give commit access too people interested in helping maintain ide-python.

As a replacement for atom-ide-ui, I can highly recommend the community supported IDE packages which provide 80% of the functionality and are maintained by the Atom IDE community.

lgeiger avatar Mar 15 '20 22:03 lgeiger

@hermidalc Thanks for asking. I agree ide-python hasn't received enough attention from my side lately. Largely due to the fact that I now have a full time job instead of being a lazy student, I no longer have so much time and energy to maintain ide-python and answer issues. However this doesn't mean the project is abandoned. I still use it on a daily basis and will provide critical fixes, merge PRs or add support for new features from the language server.

@lgeiger thanks for the response. The most pressing thing right now regarding this issue is that ide-python does not work anymore with newer versions of pyls, so would consider this a semi-critical issue.

I use ide-python every day like you for a long time and think it’s really great.

hermidalc avatar Mar 15 '20 22:03 hermidalc

As a replacement for atom-ide-ui, I can highly recommend the community supported IDE packages which provide 80% of the functionality and are maintained by the Atom IDE community.

Thanks for pointing me to this page, I thought all the ide-* language packages needed atom-ide-ui so glad to hear there are some workarounds.

hermidalc avatar Mar 15 '20 22:03 hermidalc

The most pressing thing right now regarding this issue is that ide-python does not work anymore with newer versions of pyls, so would consider this a semi-critical issue.

I am currently using pyls==0.31.8 and the latest versions of https://atom-ide-community.github.io/ instead of atom-ide-ui with Python 3.7.7 on macOS and I haven't run into any issues so far. So unfortunately I am not in a good place to debug those issues.

lgeiger avatar Mar 15 '20 23:03 lgeiger

The most pressing thing right now regarding this issue is that ide-python does not work anymore with newer versions of pyls, so would consider this a semi-critical issue.

I am currently using pyls==0.31.8 and the latest versions of https://atom-ide-community.github.io/ instead of atom-ide-ui with Python 3.7.7 on macOS and I haven't run into any issues so far. So unfortunately I am not in a good place to debug those issues.

It might be that many of us are still using atom-ide-ui based Atom IDE and it’s the root cause of the problem. I will do the Atom IDE Community workaround to packages and will report back if all fixed then close this issue if all is ok.

hermidalc avatar Mar 15 '20 23:03 hermidalc

I like this kit myself, and it is relatively stable compared to Linter related kits. Currently I still use Linter, because the error problem persists and cannot help me check it.

Has anyone continued to improve the atom-ide-ui suite that has been stopped? If atom-ide-ui is improved and pretty good, can I use the improved kit? How can I help if I want to help this project?

timmy61109 avatar Mar 16 '20 03:03 timmy61109

@hermidalc I already checked this few hours ago. No, with atom-ide-community issue still the same, it's not atom-ide-ui-related. Not all pyls versions was checked in between 0.31.2-0.31.9, but, as @ProfesseurChep noted above, works with 0.31.2, does not work with latter.

apm list --installed --enabled

Community Packages (15) /home/<user>/.atom/packages ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] └── [email protected]

okaminoseishin avatar Mar 21 '20 23:03 okaminoseishin

@hermidalc I already checked this few hours ago. No, with atom-ide-community issue still the same, it's not atom-ide-ui-related. Not all pyls versions was checked in between 0.31.2-0.31.9, but, as @ProfesseurChep noted above, works with 0.31.2, does not work with latter.

apm list --installed --enabled Community Packages (15) /home//.atom/packages ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] └── [email protected]

@lgeiger @okaminoseishin what versions of Atom are you using? @okaminoseishin what OS are you using?

hermidalc avatar Mar 22 '20 00:03 hermidalc

OS: Arch Linux

atom --version

Atom: 1.45.0 Node: 10.11.0 Electron: 4.2.7 Chrome: 69.0.3497.128

EDIT: all checks was done inside clean virtualenv, pointing atom to it's interpreter.

okaminoseishin avatar Mar 24 '20 00:03 okaminoseishin

OS: Arch Linux atom --version

EDIT: all checks was done inside clean virtualenv, pointing atom to it's interpreter.

I also am using (Fedora) Linux. Sorry that I haven't had a chance to also set up a test with the Atom IDE Community packages and I appreciate it. Could you report (for @lgeiger) what errors you are seeing in the Atom Developer Tools Console? If ide-python isn't working you typically should see errors there. Since he isn't having a problem with his setup and versions on Mac, this would be helpful.

hermidalc avatar Mar 26 '20 14:03 hermidalc

OS: Arch Linux atom --version EDIT: all checks was done inside clean virtualenv, pointing atom to it's interpreter.

I also am using (Fedora) Linux. Sorry that I haven't had a chance to also set up a test with the Atom IDE Community packages and I appreciate it. Could you report (for @lgeiger) what errors you are seeing in the Atom Developer Tools Console? If ide-python isn't working you typically should see errors there. Since he isn't having a problem with his setup and versions on Mac, this would be helpful.

Actually sorry I don't see any errors in the Developer Tools Console pyls looks to be working fine but it doesn't display any lint anything.

hermidalc avatar Mar 26 '20 14:03 hermidalc

@hermidalc try to close all opened files, restart editor, activate virtualenv if applicable, open console and select file from tree view.

@lgeiger console.log

okaminoseishin avatar Mar 26 '20 18:03 okaminoseishin

pip install 'python-language-server[all]'==0.31.2 and restart of Atom did it for me. MacOS Catalina 10.15.4, python 3.6.4, Atom 1.45.0 with atom-ide-ui Have we verified that these newer pyls versions are working at all?

gachteme avatar Mar 26 '20 19:03 gachteme

I've done a fresh install of latest Atom 1.45 (on Linux), latest Atom IDE Community packages and requirements, and new conda environment with:

python                    3.8.2           h8356626_5_cpython    conda-forge
python-jsonrpc-server     0.3.4                      py_0    conda-forge
python-language-server    0.31.9           py38h32f6830_0    conda-forge

I tested individually turning on/off ide-python modules, mccabe, pycodestyle, pydocstyle, and pylint all appear to work.

But both flake8 and PyFlakes do not work and they give many pyls stderr yellow colored warnings (which look like errors) and occassionally red color errors like:

/home/hermidalc/.atom/packages/ide-python/node_modules/atom-languageclient/build/lib/logger.js:12 Python (pyls) rpc.sendRequest textDocument/hover threw ResponseError: TypeError: 'NoneType' object is not callable
    at handleResponse (/home/hermidalc/.atom/packages/ide-python/node_modules/vscode-jsonrpc/lib/main.js:436:48)
    at processMessageQueue (/home/hermidalc/.atom/packages/ide-python/node_modules/vscode-jsonrpc/lib/main.js:263:17)
    at Immediate.setImmediate (/home/hermidalc/.atom/packages/ide-python/node_modules/vscode-jsonrpc/lib/main.js:247:13)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)
error @ /home/hermidalc/.atom/packages/ide-python/node_modules/atom-languageclient/build/lib/logger.js:12
/home/hermidalc/.atom/packages/atom-ide-datatip/lib/datatip-manager.js:342 ResponseError: TypeError: 'NoneType' object is not callable
    at handleResponse (/home/hermidalc/.atom/packages/ide-python/node_modules/vscode-jsonrpc/lib/main.js:436:48)
    at processMessageQueue (/home/hermidalc/.atom/packages/ide-python/node_modules/vscode-jsonrpc/lib/main.js:263:17)
    at Immediate.setImmediate (/home/hermidalc/.atom/packages/ide-python/node_modules/vscode-jsonrpc/lib/main.js:247:13)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)

The many pyls errors are the same as what @okaminoseishin showed in the attached console.log.

So there is clearly something going wrong and it's with flake8 and PyFlakes modules and how they are working with pyls and ide-python.

hermidalc avatar Mar 28 '20 18:03 hermidalc

What's even worse is that python-language-server=0.31.2 is not installable from conda-forge anymore, because for some reason it and certain other 0.31.x versions are labeled broken. So if you have conda-forge based envs (which I think most do) then it's not possible to get a working ide-python and atom-ide-* environment, at least on Linux, anymore.

So for now I'm saying goodbye ide-python and atom-ide-* and going to linter based Atom packages as these all work.

hermidalc avatar Mar 28 '20 18:03 hermidalc

Maybe this is a bug with pyls on Linux and not ide-python???

hermidalc avatar Mar 28 '20 18:03 hermidalc

Actually I found with PyFlakes and pylint I do not get linting displayed if the source code file is too many lines? No console warnings or errors. I have an example script that is over 1900 lines long. If I cut out lines to <1900 then suddenly the PyFlakes and pylint linting starts working, and the moment I paste the lines back then suddenly linting disappears! @lgeiger do you think this is actually an issue with ide-python or with pyls?

hermidalc avatar Mar 28 '20 19:03 hermidalc

What's even worse is that python-language-server=0.31.2 is not installable from conda-forge anymore, because for some reason it and certain other 0.31.x versions are labeled broken. So if you have conda-forge based envs (which I think most do) then it's not possible to get a working ide-python and atom-ide-* environment, at least on Linux, anymore.

I could actually get python-language-server=0.31.2 reinstalled with atom-ide-* and ide-python. Looks like the potential issue(s) on Linux with flake8 and possibly PyFlakes are due to pyls. Will hope to see what they say in the issue.

hermidalc avatar Mar 30 '20 03:03 hermidalc

@timmy61109 @mark-fangzhou-xie @vepain @okaminoseishin @gachteme could you please also comment that pyls >0.31.2 flak38 and pyflakes plugins are also not working for you in the pyls issue I opened https://github.com/palantir/python-language-server/issues/769?

It would help get the ball rolling over there. I've tested as of 0.31.10 it doesn't work. Same pyls errors in Atom dev console when flake8 or pyflakes plugins are enabled. If you disable them other plugins worked at least for me.

hermidalc avatar Apr 19 '20 15:04 hermidalc

@hermidalc Ok.

timmy61109 avatar Apr 19 '20 23:04 timmy61109