You are not logged in.

#1 2019-09-06 16:44:30

mehran
Member
Registered: 2018-09-27
Posts: 5

Problem with pyls and jedi

Hi,
I installed python-language-server package and configured my vim to use lsp in order to autocomplete for python. but it's not working on my arch linux machine while the exact same config in other machine with another OS is working correctly.

when I run pyls command I'll get this output:

 ➜  ~ pyls
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (jedi 0.13.3 (/usr/lib/python3.7/site-packages), Requirement.parse('jedi<0.15,>=0.14.1'), {'python-language-server'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pyls", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3250, in <module>
    @_call_aside
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3234, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3263, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'jedi<0.15,>=0.14.1' distribution was not found and is required by python-language-server

It seems there's a problem with jedi version which is the latest version in Arch official repos. I tried to install jedi 0.15 by pip but after installation there's still same error!
what should I do??

Last edited by mehran (2019-09-06 16:44:52)

Offline

#2 2019-09-06 16:47:37

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Problem with pyls and jedi

Have you been using pip to install things system-wide perhaps?

Wiki wrote:

If you must use pip, use a virtual environment, or pip install --user to avoid conflicts with packages in /usr. It is always preferred to use pacman to install software.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2019-09-06 19:42:41

mehran
Member
Registered: 2018-09-27
Posts: 5

Re: Problem with pyls and jedi

no. I always use --user or venv to install things with pip.

Offline

#4 2019-09-12 04:01:19

nhanb
Member
Registered: 2019-09-12
Posts: 1

Re: Problem with pyls and jedi

Hi, I can confirm I have the same problem, and I never messed with system-wide pip packages AFAIK.

The currently packaged version of pyls indeed requires jedi>=0.14.1 (code), while arch's jedi package is stuck at 0.13.3.

I'm not sure what's the common etiquette for informing the maintainer(s) though. Should I just email them or something?

P/s:

mehran wrote:

I tried to install jedi 0.15 by pip but after installation there's still same error!

That's because the exact constraint is jedi<0.15,>=0.14.1 which does not include 0.15. Something like `pip install --user jedi==0.14.1` should work.

Last edited by nhanb (2019-09-12 04:12:29)

Offline

Board footer

Powered by FluxBB