palantir / python-language-server

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

Pip install fails with ujson error #857

Closed zerocewl closed 3 years ago

zerocewl commented 3 years ago

Default pip installation fails with error for wrong ujson version.

pip install python-language-server

Error:

python-jsonrpc-server 0.4.0 requires ujson>=3.0.0, but you'll have ujson 1.35 which is incompatible.

Since the dependency lib python-jsonrpc-server was updated to v0.4 the updated ujson version leads to an incompatible installation with current settings ujson 1.35 in pyls.

Latest version of python-jsonrpc-server: https://pypi.org/project/python-jsonrpc-server/ Depending pr: https://github.com/palantir/python-jsonrpc-server/pull/44/files

Workaround: use python_jsonrpc_server<0.4

pip install python-jsonrpc-server<0.4
pip install python-language-server

Possible solutions:

Maybe blocked by https://github.com/palantir/python-language-server/pull/808

Quick and easy fix by https://github.com/palantir/python-language-server/pull/859

cuizaiyong commented 3 years ago

When I use pip install python-language-server[all], the same problem occurred.

izumism commented 3 years ago

Following command resolve this problem in my case. pip install python-language-server[all] --use-feature=2020-resolver

aplanas commented 3 years ago

Following command resolve this problem in my case. pip install python-language-server[all] --use-feature=2020-resolver

Uhm this should fail when the server start, as one component (pyls or the jsonrpc-server) will complain that the incorrect version of ujson is installed.

ccordoba12 commented 3 years ago

This will be fixed when PR #842 is merged and a new version is released.

GNSubrahmanyam commented 3 years ago

@ccordoba12 vendors~lsp-client.js:2 Uncaught (in promise) Error: pkg_resources.ContextualVersionConflict: (ujson 1.35 (/usr/local/lib/python3.6/dist-packages), Requirement.parse('ujson>=3.0.0'), {'python-jsonrpc-server'}) I am also getting this

aplanas commented 3 years ago

@GNSubrahmanyam this is the current bug, that ujson 1.35 is installed by requirements of pyls, but jsonrpc-server requires >=3.0. The patch from #842 fix this issue, installing ujson >=3.0 in pyls if Python 3 is used. We need to wait for the new release, or manually edit the METADATA in site-packages to fix the current mismatch

GNSubrahmanyam commented 3 years ago

@aplanas I am using python-language-server[all]==0.31.10 with monaco editor why because in latest version of python-language-server linters are not working.

\vendors~lsp-client.js:2 Uncaught (in promise) Error: pkg_resources.ContextualVersionConflict: (ujson 1.35 (/usr/local/lib/python3.6/dist-packages), Requirement.parse('ujson>=3.0.0'), {'python-jsonrpc-server'}) error i am not getting in docker container. I am getting only in ec2 instances

izumism commented 3 years ago

I use pip>=20.2 and It includes new feature of dependency resolver, but it is not included by default. The command --use-feature=2020-resolver enable this functionality as this announcement says.

ghost commented 3 years ago

Upgrading to python-language-server version 0.35.0 (https://github.com/palantir/python-language-server/releases/tag/0.35.0) solved the issue for us