atom-community / ide-python

Python language support for Atom-IDE :atom: :snake:
https://atom.io/packages/ide-python
Other
237 stars 39 forks source link

pyls initializing for ... forever again #119

Open mic-rigaud opened 6 years ago

mic-rigaud commented 6 years ago

Hello,

Since the new maj (1.0.0) I got the same problem explain here: https://github.com/lgeiger/ide-python/issues/85

However the problem seems different. The solution doesn't work and the error message in debug mode is different too. The command "pyls --help" works.

I use Atom Editor v1.25.1, and ide-python 1.0.0

pyls

Thank you,

lgeiger commented 6 years ago

Have you updated the language server to 0.19?

mic-rigaud commented 6 years ago

Yes I do: python-language-server in /usr/local/lib/python3.5/dist-packages (0.19.0) future>=0.14.0 in /usr/local/lib/python3.5/dist-packages (from python-language-server) (0.16.0) jedi>=0.12 in /usr/local/lib/python3.5/dist-packages (from python-language-server) (0.12.0) pluggy in /usr/local/lib/python3.5/dist-packages (from python-language-server) (0.6.0) parso>=0.2.0 in /usr/local/lib/python3.5/dist-packages (from jedi>=0.12->python-language-server) (0.2.1)

lgeiger commented 6 years ago

Does python -m pyls --help work?

mic-rigaud commented 6 years ago

Yes it works. It responds:

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

 Python Language Server

 optional arguments:
   -h, --help            show this help message and exit
   --tcp                 Use TCP server instead of stdio
   --host HOST           Bind to this address
   --port PORT           Bind to this port
   --log-config LOG_CONFIG
                         Path to a JSON file containing Python logging config.
   --log-file LOG_FILE   Redirect logs to the given file instead of writing to
                        stderr.Has no effect if used with --log-config.
   -v, --verbose         Increase verbosity of log output, overrides log config
                         file
MilkyHearts commented 6 years ago

I was having problems but everything worked after uninstalling the python-language-server then flake8 then reinstalling both

mic-rigaud commented 6 years ago

I already reinstall all... :'(

mic-rigaud commented 6 years ago

Is it possible to install the version 0.10.0 on atom? --> Ok I did it. And everything work fine with this version

Patlol commented 6 years ago

With
atom 1.27.2
ide-python 1.0.0
python 3.6.3

After update ide-python on 1.0.0
I have the symbol pyls initiallizing for myfile at the bottom of atom that was spinning all the time

After

sudo pip3 uninstall pydocstyle
sudo pip3 uninstall pyflakes
sudo pip3 uninstall python-language-server
sudo pip3 install python-language-server[all]  

It's ok ...

Actually

are necessary, i had

mic-rigaud commented 6 years ago

Didn't work for me. But i have atom 1.25.1, maybe the problem come from my version of atom...

Patlol commented 6 years ago

maybe, update !

mic-rigaud commented 6 years ago

I update my version of atom to 1.27.2, and nothing change. :'( The version 1.0.0 of ide-python doesn't work and the version 0.10.0 works..

ediphy-azorab commented 6 years ago

People who are having issues - how many of you are using virtualenv? I was previously using pyls installed with pipsi. With the new configuration I now have to install pyls into each different venv.

georgreen commented 6 years ago

@ediphy-azorab Same issue.

paulnikolaus commented 6 years ago

I guess this is the same error

screen shot 2018-06-11 at 3 07 11 pm

after I updated to ide-python 1.0.0.

georgreen commented 6 years ago

@paulnikolaus Plus one to that, I'm experiencing the same when I activate my virtualenv.

tnesztler commented 6 years ago

@paulnikolaus I made it work by setting the Python executable to python3 in the ide-python settings. I installed pls for Python 3.6.5 on macOS 10.13.4 using pip3 install python-language-server[all]. I don't use a virtual env though.

paulnikolaus commented 6 years ago

@thibeco I've totally overlooked this, thank you so much!

mlangiu commented 6 years ago

For those of you working with different python, conda and pip versions on a single machine like me (Windows 10 with anaconda, conda + Cygwin with it's own python and pip versions) make sure that your paths are set correctly. For me the upgrade to ide-python 1.0.0 reset the path entry in the settings to the default (python) which apparently broke pyls functionality (although I'm still not quite sure why, as I have pyls installed in all available python versions). After resetting the path to my anaconda python version (C:\Users\m.langiu\AppData\Local\Continuum\anaconda3\python.exe), everything worked again.

mzannoni commented 6 years ago

I have atom 1.27.2 with ide-python 1.0.0 on Fedora 28. The python ide used to work as a charm, then it broke (not exactly sure when... maybe after the last ide-python update).

I followed the recommendation by @Patlol (uninstall pyflakes, pydocstyles,...) then install python-language-server[all].

Now I have Successfully installed pydocstyle-2.1.1 pyflakes-2.0.0 python-language-server-0.19.0 but the "pyls initializing for ..." is still going on revolving and I have no functionality from python-ide.

Edit: I installed the previous version of ide-python with: apm install ide-python@0.10.0 And it works perfectly again. So I'd conclude that the issue is with the new version of the ide-python package.

I'm available to help in debugging (mostly by collecting debug info) if it's needed.

Edit 2: I also had the chance to test this on a different machine: Ubuntu 16.04, Atom 1.27.2, all dependencies met, etc. There everything work as a charm with the latest ide-python (1.0.0).

Edit 3: yet another machine, yet another pyls-related issue. This time it's a laptop with Ubuntu 16.04, with the same dependencies fulfilled as in 'Edit 2', but on this machine I had to roll back to ide-python 0.10.0, otherwise I had the same error reported by @paulnikolaus above ("Unable to start Python language server") and I also have some strange graphic issue (Atom makes white flashes all the time). As soon as I installed back the 0.10.0 of ide-python, everything works well again, including (and this I can't explain) the graphic.

jasampson commented 6 years ago

@mzannoni Regarding Fedora 28, I was having the exact same issue as you but was able to fix it by rolling back to v0.10.0, manually editing config.cson (File -> Edit -> Config...) and changing any occurrences of 'python3' to '/usr/bin/python3', and then upgrading to v1.0.0.

I had previously tried just changing this in the ide-python settings menu but it didn't fix the issue. This is why I mentioned the full sequence of events I followed to fix it, because there may be more at play here than I understand.

mzannoni commented 6 years ago

No improvement after updating to Atom 1.28.0. I tried to update ide-python to 1.0.0, but then it didn't work, same symptoms: pyls initilizing and spinning forever. I installed back the 0.10.0, as before, and it works perfectly again.

cdeeran commented 6 years ago

I am experiencing the same problem with version 1.0 on macOS, Atom 1.28.0, atom-ide-ui 0.12.0. I did the rollback to version 0.10.0 as previous users suggested and it is now working.

gtema commented 6 years ago

for me it also helped to switch ide-python to python3 (fresh Fedora28) having pyls installed locally pip3 install python-language-server[all] --user

mzannoni commented 6 years ago

Does it even work with Python2? I don't know where ide-python gets the python exec, but I assume it's python3. I have both installed in my machine, with the command 'python' alised to python 3. Moreover, if I run 'python2 -m pyls --help' in a terminal nothing happens, while if is do 'python3 -m pyls --help' the output is the expected one.

Anyhow... I'm still convinced ide-python is the issue in my case. I tried to update it again, after the latest update to Atom 1.28.1, but still the same. I rolled back to ver 0.10.0 and ide-python works great again.

lgeiger commented 6 years ago

if I run 'python2 -m pyls --help' in a terminal nothing happens

That's probably because you haven't installed it for this version of Python

mzannoni commented 6 years ago

Well, actually that would return: /usr/bin/python2: No module named pyls

Like: $ python2 -m pylss --help /usr/bin/python2: No module named pylss

And it is installed (checked under ...../python2.7/site-package/pyls). If I open a python2 interpreter and 'import pyls' it works.

However... does version 1.0 of ide-python need to run on python2?

lgeiger commented 6 years ago

And it is installed (checked under ...../python2.7/site-package/pyls). If I open a python2 interpreter and 'import pyls' it works.

Can you verify that you have pyls version 0.19.0 or newer installed in python 2?

mzannoni commented 6 years ago

In python 3 the version installed was 0.19. In python 2 it was actually 0.8. So, I've updated it also for python 2, with all dependencies, but this didn't help. Version 0.10.0 works, version 1.0 does not, with same symptoms.

mzannoni commented 6 years ago

It seems I found a solution, which is probably Fedora-related, that seems to work.

I changed in atom.desktop launcher the executable for Atom from /usr/share/atom/atom to /usr/bin/atom and now ide-python seems to work reliably.

I'm not sure what's the difference between the 2 executable.

Maybe somebody knows or can point to somewhere appropriate, I guess...

alanzzhao-toast commented 6 years ago

Downgraded to 0.10.0 as well. @lgeiger can you give a full explanation of how to actually upgrade to 1.0.0 without this breaking?

Your lines in the newest release do not give much insight. Thanks!

mic-rigaud commented 6 years ago

After upgrading to 1.0.0, I change the path of python executable to '/usr/bin/python3'. It works for me.

taylars commented 6 years ago

I'm having the same issue, tried uninstalling/installing pyls. Nothing has seemed to work. Here is what I am running:

Windows 7 atom (1.30.0) atom-ide-ui (0.10.0) ide-pyton (1.0.0) python-language-server (0.19.0)

I get this error in the debug console: logger.ts:19 Python (pyls) rpc.onClose The RPC connection closed unexpectedly

Any suggestions would be appreciated!

mattaw commented 6 years ago

Same, windows 10 x64 Atom 1.30.0 atom-ide-ui 0.10.0 ide-python 1.0.0

Python 3.7, executable from console. I have restarted the computer to ensure environment is clean and sync'ed.

python -m pyls --help works just fine, produces message. I have uninstalled, updated pip and setuptools and reinstalled a couple of times to make sure. Same behaviour :(.

python -m pip freeze:

astroid==2.0.4
atomicwrites==1.2.0
attrs==18.1.0
autopep8==1.3.5
colorama==0.3.9
flake8==3.5.0
future==0.16.0
isort==4.3.4
jedi==0.12.1
lazy-object-proxy==1.3.1
mccabe==0.6.1
more-itertools==4.3.0
mypy==0.620
parso==0.3.1
pep8==1.7.1
pluggy==0.7.1
py==1.6.0
pycodestyle==2.3.1
pydocstyle==2.1.1
pyflakes==1.6.0
pylint==2.1.1
pytest==3.7.3
python-jsonrpc-server==0.0.1
python-language-server==0.21.0
rope==0.11.0
six==1.11.0
snowballstemmer==1.2.1
typed-ast==1.1.0
wrapt==1.10.11
yapf==0.23.0
mattaw commented 6 years ago

Update: Downgrading python-language-server to 0.20.0 fixes the problem. That is the difference between my Windows 10 desktop that works vs. my Windows 10 laptop that didn't.

python -m pip uninstall python-language-server
python -m pip install python-language-server[all]==0.20.0

List of versions of packages that work:

astroid==2.0.4
autopep8==1.3.5
certifi==2018.8.24
chardet==3.0.4
colorama==0.3.9
Django==2.0.8
flake8==3.5.0
future==0.16.0
idna==2.7
isort==4.3.4
jedi==0.12.1
lazy-object-proxy==1.3.1
mccabe==0.6.1
oauthlib==2.1.0
parso==0.3.1
pep8==1.7.1
pluggy==0.7.1
pycodestyle==2.3.1
pydocstyle==2.1.1
pyflakes==1.6.0
pylint==2.1.1
pylint-django==2.0.2
pylint-plugin-utils==0.4
python-jsonrpc-server==0.0.1
python-language-server==0.20.0
pytz==2018.5
requests==2.19.1
requests-oauthlib==1.0.0
rope==0.11.0
six==1.11.0
snowballstemmer==1.2.1
urllib3==1.23
wrapt==1.10.11
yapf==0.23.0
Fercho120 commented 5 years ago

Mattaw is right, I had the same problem, downgrading python-language-server to 20.0 from 21 solves the issue

tobkum commented 5 years ago

Downgrading worked for me as well

ChekeGT commented 5 years ago

Downgrading worked for me 2

BigBerner commented 5 years ago

Not that anymore validation is needed, but down grading worked for me as well. BTW love the environment, moved from Spyder to ATOM and with the python ide it was painless.

lgeiger commented 5 years ago

I'm happy to accept PRs that revert #114 to restore the old behavior of ide-python@v0.1.0 if people are still having problems with the new way of starting the language server.

mohammedmusah commented 5 years ago

Downgrading it worked for me 2.

landej commented 5 years ago

I'm still having issues after downgrading and trying the fixes here. I'm using Atom 1.32, launching from command line is no issue.

Ignus3 commented 5 years ago

I was still having problems until I downgraded to pyls 0.20, like everyone above. I'd definitely recommend reverting the change in PR 114, it's extremely tricky to work around when compared to the effort required to accurately specify python directories.

I'm a lot more used to making sure environment variables and arguments are passed into a program correctly, that's not too much of a burden even for the inexperienced. (I remember doing similar things when trying to get certain PC games to work correctly or to get mods working, I'd argue that most people getting into python scripting would have a similar background experience with mods and file paths)

jkroes commented 5 years ago

Confirmed that downgrading python-language-server to 0.20.0 from 0.20.1 fixes the problem for Atom 1.32.2 and Python 3.7.1

Tooniis commented 5 years ago

Downgrading pyls to 0.20.0 does not change anything in Atom 1.32.1 flatpak.

laike9m commented 5 years ago

None worked for me. I'm using pipsi to install pyls though. EDIT: switched to pyenv install, still doesn't work.

francescodedomenico commented 5 years ago

Downgrading from last version to 0.21.2 to 0.20.0 worked for me. I'm using Atom 1.32.2 on Windows 10 x64.

Iondato commented 5 years ago

Downgrading pyls from version 0.21.2 to 0.20.0 worked for me too.

Atom 1.32.2 x64 on Windows 8.1 ide-python 1.0.0 Python 3.7.1 amd64

bryanburke commented 5 years ago

Issue appears to be fixed with python-language-server 0.21.3.

playmyskay commented 5 years ago

Issue appears to be fixed with python-language-server 0.21.3.

No, not for me.

I struggled with this a few hours but finally i got it to work with the solution below. I am using Ubuntu 18.04.

The problem is a missing path in your PATH-variable in which your pyls executable is located. I know, this is already mentioned in a comment above and you are right: extending the PATH-variable does not work (for me) either.

But then i tried to start the atom-application while extending the PATH-varibale directly like so: $ PATH=$PATH:/path/to/pyls atom

Then it works.

Hope this will help someone.

esn89 commented 5 years ago

I'm having a similar problem, I have the latest version of pyls, which is 0.21.2 and for my language server (coc.nvim) for Neovim, it returns "pyls timeout after 2000"

Anyone experience the same problem?