palantir / python-language-server

An implementation of the Language Server Protocol for Python
MIT License
2.6k stars 282 forks source link

Running pyls returns an error when run #864

Closed fabio-oesch closed 3 years ago

fabio-oesch commented 3 years ago

I have come across an issue that I have issues to resolve. Furthermore, I could not find any information that could resolve my problem. My setup is run on Fedora 30 with Emacs 26.3 (GTK+ Version).

I have followed a tutorial that should help me setup an lsp server with pyls. I have installed pyls, jedi and ran pip install --user python-language-server[all]. The issue I run into is when I run M-x lsp, it is starting up the the server but when I look into the pyls buffer it shows me that it ran into an error.

Process pyls stderr finished
Traceback (most recent call last):
  File "/home/olearry/.local/bin/pyls", line 6, in <module>
    from pyls.main import main
  File "/home/olearry/.local/lib/python3.7/site-packages/pyls/main.py", line 65
    print '%s%s' % ('    ' * indent, name)
               ^
SyntaxError: invalid syntax

I have tried finding someone who has the same issue as me but I could not find anyone. I have also tried running pyls directly from the terminal, it returns the same error. I cannot tell where my setup is flawed and I am in need of some help.

I would appreciate any help and if you have any questions please do not hesitate to ask.

Additional (probably not important) information

I presume what I've said above is the main issue but I will append some more information here that might be of interest. I have tried running it in a venv as well. I run into the same problem there. Running pyls returns the same error as above. The packages that are installed in the venv are:

➜ pipenv graph
autopep8==1.5.4
  - pycodestyle [required: >=2.6.0, installed: 2.6.0]
  - toml [required: Any, installed: 0.10.1]
flake8==3.8.3
  - importlib-metadata [required: Any, installed: 1.7.0]
    - zipp [required: >=0.5, installed: 3.2.0]
  - mccabe [required: >=0.6.0,<0.7.0, installed: 0.6.1]
  - pycodestyle [required: >=2.6.0a1,<2.7.0, installed: 2.6.0]
  - pyflakes [required: >=2.2.0,<2.3.0, installed: 2.2.0]
pydocstyle==5.1.1
  - snowballstemmer [required: Any, installed: 2.0.0]
pylint==2.6.0
  - astroid [required: >=2.4.0,<=2.5, installed: 2.4.2]
    - lazy-object-proxy [required: ==1.4.*, installed: 1.4.3]
    - six [required: ~=1.12, installed: 1.15.0]
    - typed-ast [required: >=1.4.0,<1.5, installed: 1.4.1]
    - wrapt [required: ~=1.11, installed: 1.12.1]
  - isort [required: >=4.2.5,<6, installed: 5.5.3]
  - mccabe [required: >=0.6,<0.7, installed: 0.6.1]
  - toml [required: >=0.7.1, installed: 0.10.1]
pyls==0.1.6
python-language-server==0.35.1
  - jedi [required: >=0.17.0,<0.18.0, installed: 0.17.2]
    - parso [required: >=0.7.0,<0.8.0, installed: 0.7.1]
  - pluggy [required: Any, installed: 0.13.1]
    - importlib-metadata [required: >=0.12, installed: 1.7.0]
      - zipp [required: >=0.5, installed: 3.2.0]
  - python-jsonrpc-server [required: >=0.4.0, installed: 0.4.0]
    - ujson [required: >=3.0.0, installed: 3.2.0]
  - ujson [required: >=3.0.0, installed: 3.2.0]
rope==0.17.0
yapf==0.30.0
ccordoba12 commented 3 years ago

This is a duplicate of issue #716. Please see there for the solution.

fabio-oesch commented 3 years ago

I did not find that issue. Thank you for the quick response.